Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 23562  / 2 Years ago, mon, july 25, 2022, 8:40:18

I can't get ANYTHING working on linux. I'm trying to compile CudaMiner. Output of sudo make:



ypt-jane.o `test -f 'scrypt-jane.cpp' || echo './'`scrypt-jane.cpp
mv -f .deps/cudaminer-scrypt-jane.Tpo .deps/cudaminer-scrypt-jane.Po
nvcc -g -O2 -Xptxas "-abi=no -v" -arch=compute_10 --maxrregcount=64 --ptxas-options=-v -I./compat/jansson -o salsa_kernel.o -c salsa_kernel.cu
/bin/bash: nvcc: command not found
make[2]: *** [salsa_kernel.o] Error 127
make[2]: Leaving directory `/var/progs/CudaMiner'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/progs/CudaMiner'
make: *** [all] Error 2


So, kind of interesting. Output of nvcc:



nvcc fatal   : No input files specified; use option --help for more information


Whereas the output of sudo nvcc:



sudo: nvcc: command not found


I have identical exports listed in ~/.bashrc AND /etc/bash.bashrc. (Nvcc is located in: /usr/local/cuda-5.0/bin/nvcc)



I also tried changing the current path, to no avail:



$ sudo bash -c 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ PATH=$PATH:/usr/local/cuda-5.0/bin/nvcc
$ sudo bash -c 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


Thanks in advance!


More From » nvidia

 Answers
7

So apparently, nvcc is not on the PATH when you run it with sudo. You can confirm this with:



sudo bash -c 'echo $PATH'


The easiest solution is to call sudo with the absolute path of nvcc:



sudo $(which nvcc)


When running commands without absolute path like nvcc, sudo uses the value of the secure_path configuration in /etc/sudoers as the PATH, for example in my system:



Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"


So even if you set PATH in one of the startup files that the shell normally sources, it won't work. If you want to make sudo nvcc work temporarily, just to get your build working, I think you have two options:




  • Edit the installer script and change the lines with sudo nvcc to sudo /path/to/nvcc

  • Create a symlink to nvcc in one of the directories listed in secure_path, like this: sudo ln -s /path/to/nvcc /sbin/nvcc



UPDATE



If you have a hard time finding the path of nvcc, you can try these commands, in this order (they get slower and slower), until you find a match:



which nvcc
find /usr/local/cuda-5.0 -name nvcc
find /usr/local/ -name nvcc
find /opt -name nvcc
find / -name nvcc

[#26738] Tuesday, July 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ofunn

Total Points: 164
Total Questions: 116
Total Answers: 116

Location: Liberia
Member since Fri, Oct 22, 2021
3 Years ago
;