Hi all,
I want to use Libtorch on Linux (Ubuntu 22.04). I have managed to install CUDA 11.3, CMake, and GCC-10, but when I go to build the example project using “sudo cmake .”, I get the following error:
-- The CUDA compiler identification is unknown
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - failed
-- Check for working CUDA compiler: /usr/local/cuda
-- Check for working CUDA compiler: /usr/local/cuda - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCUDACompiler.cmake:56 (message):
The CUDA compiler
"/usr/local/cuda"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/joy/Downloads/HelloTRT/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_8fa0e/fast && /usr/bin/gmake -f CMakeFiles/cmTC_8fa0e.dir/build.make CMakeFiles/cmTC_8fa0e.dir/build
gmake[1]: Entering directory '/home/joy/Downloads/HelloTRT/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_8fa0e.dir/main.cu.o
/usr/local/cuda -c /home/joy/Downloads/HelloTRT/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_8fa0e.dir/main.cu.o
gmake[1]: /usr/local/cuda: Permission denied
gmake[1]: *** [CMakeFiles/cmTC_8fa0e.dir/build.make:78: CMakeFiles/cmTC_8fa0e.dir/main.cu.o] Error 127
gmake[1]: Leaving directory '/home/joy/Downloads/HelloTRT/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_8fa0e/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
/media/joy/16A851D7A851B649/linux/libtorch-cxx11-abi-shared-with-deps-1.11.0+cu113/libtorch/share/cmake/Caffe2/public/cuda.cmake:41 (enable_language)
/media/joy/16A851D7A851B649/linux/libtorch-cxx11-abi-shared-with-deps-1.11.0+cu113/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
/media/joy/16A851D7A851B649/linux/libtorch-cxx11-abi-shared-with-deps-1.11.0+cu113/libtorch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/joy/Downloads/HelloTRT/CMakeFiles/CMakeOutput.log".
See also "/home/joy/Downloads/HelloTRT/CMakeFiles/CMakeError.log".
Since I have limited space on the Ubuntu drive, I created a softlink from /usr/local/cuda to the CUDA toolkit installation directory on another drive. I have tried setting the permissions for “Others” to be able to do everything to this folder and its contents, and have tried running cmake with “sudo”, but I still get this “Permission denied” error.
Any help would be greatly appreciated.
Thanks!
Jonah