GPU Acceleration usage with Indapps¶
Sinumerik EDGE platform is capable of enabling GPU acceleration for industrial applications. Industrial applications can opt for GPU acceleration and have their applications run on both GPU and CPU.
Note
Currently, GPU acceleration can be used for 3D rendering only.
Enable GPU access for Indapps¶
Please refer to GPU Acceleration Usage to enable GPU access for industrial applications.
Using GPU from Indapps¶
Containers of industrial applications with GPU access are automatically given access of /tmp/.X11-unix/X0
and /dev/dri/card0
files. These files are for 3D X server socket communication and GPU device file,
respectively.
Prerequisites¶
Before applications can start using GPU, there are some prerequisite commands that each container must have run before each application startup.
-
Waiting until X socket files is ready.
max_retry=5 total_retry=0 while [ ! -S /tmp/.X11-unix/X0 ]; do if [ $total_retry -ge $max_retry ]; then echo 'Exhausted all tries, exitting.' exit 1 fi total_retry=$((total_retry+1)) echo 'Waiting for X0 socket to be prepared.' sleep 1 done
This sleep loop holds program flow until the neccessary files are prepared for container. Containers which are permitted for GPU usage, may start before the relevant files are prepared for them. For that reason, this ready wait loop is essential for industrial applications that use GPU, otherwise applications may start too soon and fail to use GPU.
After successfully executing all the steps mentioned above, applications can start and use GPU.
Using GPU for 3D Acceleration¶
Industrial applications can leverage GPU to have their X11 based applications 3D accelerated. In order to achieve this, some X11 calls for graphical computings can be forwarded to 3D X server socket file. For this, solutions for remote 3D rendering can be used.
VirtualGL¶
VirtualGL is an open source program that redirects the 3D rendering commands from OpenGL applications to 3D accelerator hardware.
Installation¶
The offical repository for VirtualGL can be found at here. It is strongly advised to have latest/master installed in industrial applications which aim to have GPU 3D acceleration.
Usage¶
After installation of VirtualGL package, industrial applications can start their applications with
/usr/bin/vglrun
command prefixed to their startup command.
Such like /usr/bin/vglrun <application> <application arguments>
.
Using 3D Acceleration with VNC Server¶
Industrial applications may opt to use 3D acceleration with VNC server usage. For this reason, make sure both GPU usage and VNC server usage are configured for the application, refering from GPU Acceleration Usage, and VNC Server Usage.
After this, make sure to include both prerequisites from GPU prerequisites and VNC server prerequisites.
With satisfying all steps mentioned above, the industriall applications can start their applications with
/usr/bin/vglrun
command prefixed to their startup command. An example command would be
/usr/bin/vglrun /opt/VirtualGL/bin/glxspheres64
to test your configurations and run a sample OpenGL program.
Any questions left?
Except where otherwise noted, content on this site is licensed under the The Siemens Inner Source License - 1.1.