Cake can't find nvcc. CUDAToolkit_ROOT environment variable must be set. Ubuntu/Pop_OS 21.10

已完成

I'm trying to run a cuda program in Clion. Whenever I load the CmakeList.txt, I get the following error in the terminal:

 

Failed to find nvcc. Compiler requires the CUDA toolkit. Please set the CUDAToolkit_ROOT variable.

 

I installed Cuda as described by system76's instructions and I can run nvcc in the terminal fine. Executing `which nvcc` in the terminal reveals the path of nvcc to be /usr/lib/cuda/bin/nvcc .

 

I set an enviroment variable called CUDAToolkit_ROOT to /usr/lib/cuda and /usr/lib/cuda-11.2 and then I get the the error for both environment variable configs: Could not find nvcc executable in path specified by environment variable CUDAToolkit_ROOT=/usr/lib/cuda

 

 Any ideas on what I'm doing wrong?

评论操作 固定链接

Hello!

Please delete the CUDAToolkit_ROOT enviroment variable, add /usr/local/cuda-<version>/bin to PATH in the /etc/environment configuration file and restart the machine (see https://www.jetbrains.com/help/clion/cuda-projects.html#set-nvcc). Does it help?

-1
评论操作 固定链接

Hello

I have done as you said, but cuda does not install to usr/local/ in Pop!_OS, like vanilla ubuntu, so instead of usr/local/cuda-<version>/bin, I edited the path variable to usr/lib/cuda-<version>/bin

As such my environment looks like:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/cuda-11.2/bin"

with cuda-11.2 variable at the end. I rebooted, started a brand new Clion cuda executable, and got the same exact error message

0
评论操作 固定链接

Could you please try setting the CMAKE_CUDA_COMPILER variable to the location of the NVCC executable in File | Settings | Build, Execution, Deployment | CMake? See the second point here https://www.jetbrains.com/help/clion/cuda-projects.html#set-nvcc

0
评论操作 固定链接

Hello I have done as instructed. I get the same error. This is my setup. I tried with and without " ":

0
评论操作 固定链接

I can compile fine doing a manual cmake and running make in the terminal so I know it's not cmake's problem. This is what my cuda paths look like:

 

0
评论操作 固定链接

Please send the following materials to clion-support at jetbrains.com:

  1. Do Help | Collect Logs and Diagnostic Data and send us the resulted archive. Note that logs might contain private user's information (like file paths and names).
  2. Do Tools | CMake | Reset Cache and Reload Project and send us the entire output from the CMake tool window.
  3. CMakeOutput.log and CMakeError.log if you have them in `<project>/cmake-build-debug/CMakeFiles`
  4. The output of executing CMake in Terminal.
0

请先登录再写评论。