フィルターのクリア

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 Center および File ExchangeGet 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