LibTorch cannot be used without nvcc #78530
Labels
module: build
Build system issues
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃悰 Describe the bug
When using LibTorch in CMake via
find_package(Torch REQUIRED)
it tries to find CUDA vianvcc
. When only the runtime libraries are installed, e.g.sudo apt install cuda-libraries-11-3
then it will fail with:Since LibTorch is already compiled, it should not require
nvcc
and other development libraries to be installed.Looking at
Caffe2/public/cuda.cmake
and https://github.com/pytorch/pytorch/blob/v1.11.0/cmake/public/cuda.cmake#L29, it seems that the deprecatedfind_package(CUDA)
is used. Instead, the newFindCUDAToolkit
should be used. This will work withoutnvcc
installed.Versions
1.11 from https://download.pytorch.org/libtorch/cu113/libtorch-cxx11-abi-shared-with-deps-1.11.0%2Bcu113.zip
cc @malfet @seemethere
The text was updated successfully, but these errors were encountered: