pytorch_backend build fails with `cannot find -ltorch`
See original GitHub issueDescription
I’m building the Triton server with
./build.py --no-container-build --target-platform ubuntu --cmake-dir=$(pwd)/build --build-dir=
pwd/citritonbuild --enable-logging --enable-stats --enable-tracing --enable-metrics --enable-gpu-metrics --enable-gpu --filesystem=gcs --filesystem=azure_storage --filesystem=s3 --endpoint=http --endpoint=grpc --repo-tag=common:r21.05 --repo-tag=core:r21.05 --repo-tag=backend:r21.05 --repo-tag=thirdparty:r21.05 --backend=ensemble --backend=tensorrt --backend=python --backend=tensorflow1 --backend=tensorflow2 --backend=pytorch --repoagent=checksum --image tensorflow1,nvcr.io/nvidia/tensorflow:21.05-tf1-py3 --image tensorflow2,nvcr.io/nvidia/tensorflow:21.05-tf2-py3 --image pytorch,nvcr.io/nvidia/pytorch:21.05-py3
it fails with
[ 9%] Built target kernel-library-new
[ 13%] Built target ptlib_target
[ 27%] Built target triton-common-async-work-queue
[ 36%] Built target triton-core-serverstub
[ 68%] Built target triton-backend-utils
[ 72%] Linking CXX shared library libtriton_pytorch.so
/usr/bin/ld: cannot find -ltorch
/usr/bin/ld: cannot find -ltorchvision
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/triton-pytorch-backend.dir/build.make:121: libtriton_pytorch.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:173: CMakeFiles/triton-pytorch-backend.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
I notice the libtorch.so
and libtorchvision.so
present in the build folder.
Triton Information What version of Triton are you using? r21.05
Are you using the Triton container or did you build it yourself? I’m building it myself
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
I’m referring to the build folder
citritonbuild/pytorch/build
. I see theExtracting pytorch and torchvision libraries and includes from
in the build log at[ 13%]
. Below is the complete build log:I fixed the issue by replacing
-ltorch
and-ltorchvision
with${CMAKE_CURRENT_BINARY_DIR}/libtorch.so
and${CMAKE_CURRENT_BINARY_DIR}/libtorchvision.so
inCMakeLists.txt