Jetson Display blacks out when using the SDL Video Display block in Simulink

13 visualizzazioni (ultimi 30 giorni)
When deploying a Simulink model having SDL video Display block using Build Deploy & Start, the screen blacks out. If the same model is built using Simulink and then the executable is launched from the Jetson terminal, then it works as expected.
I have encountered this issue in the below example, when trying to deploy the model VideoStreamReceiveOnJetsonExampleModel.slx on Jetson:

Risposta accettata

Neeraj
Neeraj il 27 Nov 2024
Modificato: Neeraj il 27 Nov 2024
When launching any graphical application on NVIDIA Jetson using MATLAB, MATLAB needs to access the local Display server session.
To access the local Display server MATLAB requires two things:
  • Setting the proper display environment using the $DISPLAY environment variable
  • Using proper authentication information (xauth cookies)
To set up the two requirements, follow the below steps,
1. To get the display environment, on the Jetson board, in your shell, execute the command,
echo $DISPLAY
The command outputs the hostname (the machine where the Display server is running) followed by the display environment number, for example,
:1.0
The application must use the same display environment as the Jetson board. In the Simulink model, open the Configuration Parameters dialog. On the Hardware Implementation pane, in the Target Hardware Resources section, in the Build Options tab, set the Display model configuration parameter to the value output by your board, which for the example shown above is ‘1.0’.
This can also be done programmaticaly using the 'setDisplayEnvironment' method of the Hardware Object as shown in the below command,
hwobj = jetson('IPAddress','username','password');
hwobj.setDisplayEnvironment('1.0');
2. When you log in to the Jetson board, the environment variable $XAUTHORITY points to the file containing the authentication information required to access the local Display server. To view the contents of the $XAUTHORITY environment variable, use the below command:
echo $XAUTHORITY
If the output of the above command is different than '~/.Xauthority' which is what MATLAB expects, then the authentication files need to be merged using the below command:
xauth -f ~/.Xauthority merge $XAUTHORITY &> /dev/null
The authentication information updates every time the user logs in to the Jetson device hence, the above command should be run at each new login. To automate this, the above-mentioned command can be added to the end of the file ‘~/.profile’.

Più risposte (0)

Categorie

Scopri di più su Deployment in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by