Headless Rendering on Jetson Orin NX device

Hello everyone. I have a Jetson orin NX an i’m trying to run a few softawares on it with a few restrictions :

  1. I have to be able to use “nvdrmvideosink” since i’m using the display port to communicate with another device. No login screen allowed .
  2. Render rviz headlessly, with the gpu (robotic visualization ) which needs a screen.

But to use drm, i need to shut down gdm.
I though about going around the probelm by usig a combo of xvfb + virtualgl (for gpu rendering). But when i disable gdm, the rendering of my rviz application goes right back to cpu (llvmpipe) and when i enable , it goes back to gpu rendering.
Does someone have an explanation for it or a way to help me solve my problem ?

Hi Ausborne,

Are you using the devkit or custom board for Orin NX?
What’s the Jetpack version in use?

Have you tried to run $ export DISPLAY=:0 for headless mode in your case?

Yes i have. Here are more infos about my sofware setup :

  • Infos about the jetpack and board can be seen attached (jtop view). For some other reasons i cannot go to Jetpack6 (ubuntu has to stay at version 20.x )

  • virtualgl 3.0.x , built from source , configured with glx+egl backend.

  • xvfb ( 2:1.20.13-1ubuntu1~20.04.17)

  • ros noetic dektop

  • All necesary gstreamer plugins installed

  • gdm disabled ( sudo systemctl disabled gdm3.service)

Now to run my rviz application i do this

export DISPLAY=:1
Xvfb $DISPLAY -screen 0 1920x1080x24 &
vglrun -d :1  rviz

And i get the following output :
[ INFO] [1728892262.860370544]: rviz version 1.14.25 [ INFO] [1728892262.860478450]: compiled against Qt version 5.12.8 [ INFO] [1728892262.860502579]: compiled against OGRE version 1.9.0 (Ghadamon) [ INFO] [1728892262.875376616]: Forcing OpenGl version 0. [ INFO] [1728892264.075567748]: Stereo is NOT SUPPORTED [ INFO] [1728892264.075728871]: OpenGL device: llvmpipe (LLVM 12.0.0, 128 bits) [ INFO] [1728892264.075799017]: OpenGl version: 3.1 (GLSL 1.4).

It seems you are using JP5.1.1(R35.3.1).
You can also verify with the latest JP5 release, which should be JP5.1.4(R35.6.0).

They are all info rather than error.
May I know what’s your current status after you run those commands?

Yes those are info, and technically it works , but my problem is the fact that it runs on the cpu ( OpenGL device: llvmpipe) . But with gdm active, no display plugged , the device is OpenGL device: NVIDIA Tegra Orin (nvgpu)/integrated . So my true purpose is to render a gui application on gpu, with gdm disabled.

It seems the device is run with iGPU on Orin at this moment.
May I know the purpose to disable gdm?

I want to disable gdm to use the nvdrmvideosink gstreamer plug-in.
I’m following the instructions here

sudo systemctl stop gdm # or disable altogether in my case
sudo loginctl terminate-seat seat0
sudo modprobe nvidia-drm modeset=1
gst-launch-1.0 videotestsrc ! nvdrmvideosink # Test nvdrmvideosink gstreamer plugin

Hello @KevinFFF . I think i finally found a solution to my problem.
I had to run a few steps before doing it though. If anyone out there needs to run rviz headlessly ( rviz_camera_stream plugin ) and display through hdmi at the same time. Here are the step i followed :

1 Disable Gdm and load drm at boot

sudo systemctl disable gdm

Then we will want to load drm kernel at boot.
For that add the following line to /etc/modules file :

nvidia-drm

Now create or edit the following file /etc/modprobe.d/nvidia-drm.conf . Then edid it

options nvidia-drm modeset=1

After making the changes, rebuild the initramfs (initial RAM filesystem) to ensure the module options are loaded at boot:

sudo update-initramfs -u

Reboot !!

sudo reboot 

2 Do your Drm display here

For some wierd reason, launching xorg before using drm makes the gstreamer pipeline fail.

gst-launch-1.0 videotestsrc  pattern=1 ! video/x-raw , width=1920 , height=1080 , format=NV12 , framerate=30/1 ! nvdrmvideosink sync=false ## Here you can use a real camera or an image for real display

3 Configure Xorg for headless setup

First create a new xorg configutaton file file to be able to use xord without any physical dislay at all

sudo vim /etc/X11/10-xorg-headless.conf 

Add the following lines to the file :

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration" "True"
    Option "UseDisplayDevice" "None"
EndSection

Start the X server without any display

sudo Xorg :99 -noreset +extension GLX +extension RANDR +extension RENDER -logfile /var/log/Xorg.99.log -config /etc/X11/10-xorg-headless.conf & 

Now you can run an application requiring X on the gpu

sudo apt install mesa-utils 
export DISPLAY=:99 
glxinfo | grep OpenGL  ## This will show you the device being used in the by the Xorg server
# rviz 
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.