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"
0 个评论
采纳的回答
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
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.
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!