The CUDA compiler "/usr/bin/nvcc" is not able to compile a simple test program.
Hi! I'm trying to use CUDA as a first-class language. I have cuda toolkit properly installed and I can use the old approach with FindCUDA without any problem.
Here is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.11) project(test_cmake_cuda LANGUAGES CXX CUDA)
after cmake ../
I got the following output:
/usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/slovak/test_cmake_cuda -- The CUDA compiler identification is unknown -- Check for working CUDA compiler: /usr/bin/nvcc -- Check for working CUDA compiler: /usr/bin/nvcc -- broken CMake Error at /usr/local/share/cmake-3.11/Modules/CMakeTestCUDACompiler.cmake:46 (message): The CUDA compiler
"/usr/bin/nvcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/slovak/test_cmake_cuda/cmake-build-debug/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTC_10b25/fast" /usr/bin/make -f CMakeFiles/cmTC_10b25.dir/build.make CMakeFiles/cmTC_10b25.dir/build make[1]: Entering directory '/home/slovak/test_cmake_cuda/cmake-build-debug/CMakeFiles/CMakeTmp' Building CUDA object CMakeFiles/cmTC_10b25.dir/main.cu.o /usr/bin/nvcc -x cu -c /home/slovak/test_cmake_cuda/cmake-build-debug/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_10b25.dir/main.cu.o Internal error: assertion failed at: "/dvs/p4/build/sw/rel/gpu_drv/r384/r384_00/drivers/compiler/edg/EDG_4.12/src/cmd_line.c", line 10726 1 catastrophic error detected in this compilation. Compilation aborted. Aborted (core dumped) CMakeFiles/cmTC_10b25.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_10b25.dir/main.cu.o' failed make[1]: *** [CMakeFiles/cmTC_10b25.dir/main.cu.o] Error 134 make[1]: Leaving directory '/home/slovak/test_cmake_cuda/cmake-build-debug/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_10b25/fast' failed make: *** [cmTC_10b25/fast] Error 2
CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred! See also "/home/slovak/test_cmake_cuda/cmake-build-debug/CMakeFiles/CMakeOutput.log". See also "/home/slovak/test_cmake_cuda/cmake-build-debug/CMakeFiles/CMakeError.log".
[Finished]