1
votes

System Configuration: Ubuntu 16.04, Nvidia GTX 1060 Cuda Tool Kit: 9.0

I installed Cuda 9.0 on my system and am able to output nvidia-smi However, when I am trying to make darknet with GPU I am getting the following error:

nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -Ofast -DGPU" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o /bin/sh: nvcc: command not found make: *** [obj/convolutional_kernels.o] Error 127

2

2 Answers

5
votes

I had the same error and found out that the cuda path was not correctly added. These are some post installation steps necessary after CUDA installation. You might as well add them to your ~/.bashrc file.

$ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}

$ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Post Installation Steps

0
votes

its fixed for me thx.

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

i am using cuda 10.1 version and this also working for that version.