Unable to find 'nvcc'
63 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dmitry Sartakov
am 3 Jun. 2019
Kommentiert: 贝宁 竺
am 10 Apr. 2022
Hi! I'm start learning programming Jetson TX2. After installing all packages i try code from help:
>> envCfg = coder.gpuEnvConfig('jetson'); % Use 'drive' for NVIDIA DRIVE hardware
envCfg.BasicCodegen = 1;
envCfg.Quiet = 1;
envCfg.HardwareObject = hwobj;
coder.checkGpuInstall(envCfg);
and get answer:
Error using coder.checkGpuInstall (line 32)
One or more of the system checks did not pass, with the following errors ...
Compatible GPU: (Invalid CUDA device id: 0. Select a device id from the range 0:-1)
CUDA Environment: (Unable to find 'nvcc' on the system path. Update the '.bashrc' script on the target to setup the 'PATH'
environment variable.)
but on TX2 have:
user@user-tx2:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sun_Sep_30_21:09:22_CDT_2018
Cuda compilation tools, release 10.0, V10.0.166
user@user-tx2:~$ echo $PATH
/usr/local/cuda-10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
How fix problem with nvcc?
3 Kommentare
Kevin Jia
am 4 Nov. 2019
Has this issue been resolved? If so, would you please share how to get it done?
Thanks,
Kevin
Akzeptierte Antwort
Alejandro Josue Calderon Torres
am 11 Dez. 2019
Hi,
I was having the same problem, I solved it by correctly modifying the .bashrc file. In the .bashrc file of your Jetson board look for this section:
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
And modify it like this:
# If not running interactively, don't do anything
case $- in
*i*) ;;
*)
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
return;;
esac
This way now coder.checkGpuInstall(envCfg); passes without errors or warnings.
Best regards
2 Kommentare
Tohru Kikawada
am 27 Jan. 2021
This is now described in "Environment Variable on the Target" section in the official documentation.
Weitere Antworten (1)
Walter Roberson
am 3 Jun. 2019
When you start MATLAB from an icon, it does not go through a login shell. Copying from a previous posting of mine, https://www.mathworks.com/matlabcentral/answers/27762-executing-unix-commands-set-in-path-in-matlab-does-not-work-with-unix-command#comment_194290
[your current PATH configuration might be done in] /etc/profile or ~/.bash_profile or ~/.bash_login or ~/.profile as those are the ones checked for interactive login, which would not be the case in this situation. However, ~/.bashrc would be used for interactive non-login shells, and for any shell the environment variable BASE_ENV is checked and if it refers to a file then the file is sourced. But if the shell was invoked as "sh" instead of as "bash" then some of the above files are skipped and the environment variable examined is ENV instead of BASE_ENV
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with GPU Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!