Error cannot find -ltorch and ltorchvision in building PyTorch Backend along with Triton Server in Oracle Linux 7.9
See original GitHub issueDescription I am trying to build Triton Server with pytorch backend I am getting this error:
[100%] Linking CXX shared library libtriton_pytorch.so
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/triton-pytorch-backend.dir/link.txt --verbose=0
/usr/bin/ld: cannot find -ltorch
/usr/bin/ld: cannot find -ltorchvision
collect2: error: ld returned 1 exit status
make[2]: *** [libtriton_pytorch.so] Error 1
make[2]: Leaving directory `/tmp/citritonbuild/pytorch/build'
make[1]: *** [CMakeFiles/triton-pytorch-backend.dir/all] Error 2
make[1]: Leaving directory `/tmp/citritonbuild/pytorch/build'
make: *** [all] Error 2
error: make install failed
I am using this command:
./build.py --cmake-dir=/home/git/server/build --build-dir=/tmp/citritonbuild --no-container-build --endpoint=http --endpoint=grpc --repo-tag=common:r21.04 --repo-tag=core:r21.04 --repo-tag=backend:r21.04 --repo-tag=thirdparty:r21.04 --backend=pytorch:r21.04 --enable-logging --enable-stats --enable-tracing
Triton Information What version of Triton are you using?
Are you using the Triton container or did you build it yourself? Yes. I am building it myself. I am using r21.04 release
To Reproduce Steps to reproduce the behavior. Use oracle linux 7.9 or centos 7.9 for build.
Describe the models (framework, inputs, outputs), ideally include the model configuration file (if using an ensemble include the model configuration file for that as well).
Expected behavior A clear and concise description of what you expected to happen.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
I found a more elegant solution. modifying CMakeLists.txt line 276-279 to set(TRITON_PYTORCH_LDFLAGS “-L${CMAKE_CURRENT_BINARY_DIR}”) will solve the problem.
Error says - tritonserver is not able to find the libtrititon_pytorch library. Copy the install binaries of pytorch to tritonserver directory go to directory:
cd /tmp/citritonbuild/pytorch/install
Then copy backends, lib and lib64 to /opt/tritonserver