True headless rendering

Typically: "How do I... ", "How can I... " questions
Post Reply
coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

True headless rendering

Post by coppelia »

Running CoppeliaSim in headless mode is achieved with the -h command line option.

On a headless server, you can also run CoppeliaSim with hardware acceleration, using VirtualGL. VirtualGL is an open source toolkit that gives any Unix or Linux remote display software the ability to run OpenGL applications with full 3D hardware acceleration. First insure that you have the nVidia proprietary driver installed. I.e. you should get an output when running nvidia-smi. Now run the following commands:

Code: Select all

sudo apt-get install xorg libxcb-randr0-dev libxrender-dev libxkbcommon-dev libxkbcommon-x11-0 libavcodec-dev libavformat-dev libswscale-dev
sudo nvidia-xconfig -a --use-display-device=None --virtual=1280x1024
# Install VirtualGL
wget https://sourceforge.net/projects/virtualgl/files/2.5.2/virtualgl_2.5.2_amd64.deb/download -O virtualgl_2.5.2_amd64.deb
sudo dpkg -i virtualgl*.deb
rm virtualgl*.deb
You will now need to reboot, and then start the X server:

Code: Select all

sudo reboot
nohup sudo X &
If nohup sudo X above fails (check the output of the nohup.out file), try to run this first:

Code: Select all

sudo /etc/init.d/gdm3 stop
Now we are good to go! To render the application with the first GPU, you can do the following:

Code: Select all

export DISPLAY=:0.0
./coppeliaSim.sh
To render with the second GPU, you will instead set display as: export DISPLAY=:0.1, and so on.

Special thanks to Stephen James for above instructions.

pwyq
Posts: 18
Joined: 28 May 2021, 19:30

Re: True headless rendering

Post by pwyq »

Does this mean that vision sensor is supported in the headless mode?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: True headless rendering

Post by coppelia »

Yes. As long as your headless server has a GPU, and you start CoppeliaSim with the -h option, above should work.

On the other hand, using the CoppeliaSim headless library ( i.e. libcoppeliaSimHeadless.so ) will not work for vision sensors, unless they are using the POV-Ray render mode (via the POV-Ray external renderer).

Cheers

Post Reply