필터 지우기
필터 지우기

Unable to find 'nvcc'

조회 수: 63 (최근 30일)
Dmitry Sartakov
Dmitry Sartakov 2019년 6월 3일
댓글: 贝宁 竺 2022년 4월 10일
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
Kevin Jia
Kevin Jia 2019년 11월 4일
Has this issue been resolved? If so, would you please share how to get it done?
Thanks,
Kevin
贝宁 竺
贝宁 竺 2022년 4월 10일
I have the same problem in Jetson TX2 nx. How did you solve it?

댓글을 달려면 로그인하십시오.

채택된 답변

Alejandro Josue Calderon Torres
Alejandro Josue Calderon Torres 2019년 12월 11일
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
Safwana Razak
Safwana Razak 2020년 2월 25일
Thanks Alejandro!! this is the best solution so far.
Tohru Kikawada
Tohru Kikawada 2021년 1월 27일
This is now described in "Environment Variable on the Target" section in the official documentation.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2019년 6월 3일
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

카테고리

Help CenterFile Exchange에서 Get Started with GPU Coder에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by