CUDA Compiler is not able to compile a simple test program

I am trying to set up CUDA in CLion, though I get an error when I try to do this. I have gotten CUDA to work in the command line and it successfully compiles, runs and can profile a program.

I am not sure how to fix this issue, though it appears that there is no test project to be compiled?

 

Here is the error I am receiving:

-- The CUDA compiler identification is NVIDIA 11.0.194
-- Check for working CUDA compiler: /cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/bin/nvcc.exe
-- Check for working CUDA compiler: /cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/bin/nvcc.exe -- broken
CMake Error at /cygdrive/c/Users/penci/AppData/Local/JetBrains/CLion2020.1/cygwin_cmake/share/cmake-3.16.5/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler

"/cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/bin/nvcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /cygdrive/c/Users/penci/OneDrive/Desktop/Code/C-Cpp/CUDA PLEASE/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make.exe cmTC_9c506/fast && /usr/bin/make -f CMakeFiles/cmTC_9c506.dir/build.make CMakeFiles/cmTC_9c506.dir/build
make[1]: Entering directory '/cygdrive/c/Users/penci/OneDrive/Desktop/Code/C-Cpp/CUDA PLEASE/cmake-build-debug/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_9c506.dir/main.cu.obj
"/cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/bin/nvcc.exe" -x cu -c "/cygdrive/c/Users/penci/OneDrive/Desktop/Code/C-Cpp/CUDA PLEASE/cmake-build-debug/CMakeFiles/CMakeTmp/main.cu" -o CMakeFiles/cmTC_9c506.dir/main.cu.obj
c1xx: fatal error C1083: Cannot open source file: 'C:/cygdrive/c/Users/penci/OneDrive/Desktop/Code/C-Cpp/CUDA PLEASE/cmake-build-debug/CMakeFiles/CMakeTmp/main.cu': No such file or directory
main.cu
make[1]: *** [CMakeFiles/cmTC_9c506.dir/build.make:66: CMakeFiles/cmTC_9c506.dir/main.cu.obj] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/penci/OneDrive/Desktop/Code/C-Cpp/CUDA PLEASE/cmake-build-debug/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_9c506/fast] Error 2






CMake will not be able to correctly generate this project.

 

I have been trying to fix this issue for days now and have gotten no closer to a solution. Any help would be greatly appreciated

Thanks!

 

2

请先登录再写评论。