Unable to connect Jetson Orin NX with MATLAB

6 次查看(过去 30 天)
I am trying the GPU profiling example to test my jetson orin NX, i have installed jetpack 6.0, CUDA 12.2, cuDNN, TensorRT, OpenCV, GStreamer, also done with the SDL Libraries.
it shows the following error:
FAILED (Unable to find GPU information. This is due to the missing of 'nvcc' on the system path. Update the '.bashrc' script on the target to set up the required environment variables.) CUDA Environment
This is the example i am working on: https://www.mathworks.com/help/gpucoder/ug/gpu-profiling-nvidia-jetson.html , i have followed all the steps mentioned and all the links attched in this example.
I have also pasted the envoirnment variables in the ~/.bashrc file,
case $- in
*i*) ;;
*)
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
return;;
esac
also updated the envoirnment file
PATH="/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
LANG="en_US.UTF-8"
LD_LIBRARY_PATH="usr/local/cuda/lib64"

采纳的回答

Kautuk Raj
Kautuk Raj 2025-7-22
This issue arises because the environment variables PATH and LD_LIBRARY_PATH are not set during non-interactive SSH sessions, which Simulink uses to connect to the Jetson device.
To fix this, update the .bashrc file on your Jetson Orin Nano to ensure the required environment variables are set even in non-interactive sessions.
Add the following to the bottom of your .bashrc:
# If not running interactively, set up environment variables
case $- in
*i*) ;;
*)
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
return;;
esac
This ensures that the CUDA-related paths are added even when accessed through non-interactive sessions like from Simulink or MATLAB.
For more detailed setup instructions, refer to the following MathWorks documentation page: https://www.mathworks.com/help/coder/nvidia/ug/install-and-setup-prerequisites.html
  2 个评论
Walter Roberson
Walter Roberson 2025-7-22
@Syed Muhammad indicated that he already has that code in his .bashrc
To fix this, update the .bashrc file on your Jetson Orin Nano
to ensure the required environment
variables are set even in non-interactive sessions.
Nothing you can do to your .bashrc file can account for the problem that .bashrc is never executed for non-interactive shells.
When Bash is started non-interactively, to run a shell script,
for example, it looks for the variable BASH_ENV in the environment,
expands its value if it appears there, and uses the expanded value
as the name of a file to read and execute.
Syed Muhammad
Syed Muhammad 2025-7-22
Thankyou for the answer the issue is resolved it was a non bug inside MATLAB 2024a with getGpuInfo.p file within support package, -arch sm=35, and thats why i was receiving the error, contacted MATLAB they helped me remove the error, shout out to @sai charan sampara.
here the steps they asked me to follow:
  1. Remove the "-arch=sm_35" from the "makeCmd" variable on line 18 of "getGpuInfo.m".
path to the file "C:\ProgramData\MATLAB\SupportPackages\R2024a\toolbox\target\supportpackages\nvidia\+nvidiaio\+internal"
  1. Delete the previous "getGpuInfo.p" file. (delete getGpuInfo.p)
  2. Create a new p-file was generated from the updated ".m" file (pcode getGpuInfo.m)
  3. Rehashing the toolbox cache and path. (rehash tooboxcache; rehash path;)
I hope it helps.

请先登录,再进行评论。

更多回答(0 个)

产品

Community Treasure Hunt

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

Start Hunting!

Translated by