we're trying to use GLU's tesselation functions on a headless, GNU/linux server. We'd like to use PyOpenGL for that, but the problem is that it crashes on a call to gluNewTess (Segmentation fault)
gdb backtrace says it's in glGetError, that makes me think that GLU tesselation needs a GL context? Or is it just some intricacy in PyOpenGL?
I tried to find some information on how to initialize GL context on a headless (and virtualized) machine, no luck. Any information on these topics is appreciated.
A headless server is a computing device without a local interface that is dedicated to providing services to other computers and their users. Headless, in this context, basically means that the computing device has no monitor or peripherals, such as a keyboard and mouse.
One can make a server a headless server by connecting it to a network and removing the monitor, mouse, keyboard, and peripherals. The only way to access a headless server is to use networking tools such as ssh and vnc server. You may ask why somebody needs to create a headless server.
Going Headless Almost any Linux server can be configured to go headless by enabling ssh or telnet, then disconnecting the monitor, keyboard and mouse. Reset all default passwords with secure passwords. Fire up a second computer on the same network, start the ssh or telnet client and log on to the headless server.
A headless terminal is a terminal with an internal screen buffer. When the display is changed, the change event is emitted with the display buffer as an argument.
easiest:
Xvfb :5 -screen 0 800x600x24 &
export DISPLAY=:5
glxgears
instead of glxgears, replace with your program, and stick a 'glutInit()' into your python code to get a basic GL window.
harder:
rewrite your program to create an GL context using the OSMesa library
hardest:
rip the guts out of the GLU tesselator and stick it in your project (download the MesaLib source code)
Most of the options at VJovic's link aren't hardware accelerated and all of them are deprecated in favor of the OpenGL Framebuffer Object extension (Notice the date: 1997!). Also, offscreen rendering isn't the whole solution, as Calvin1602 noted, you need an openGL context (except for OSMesa, which uses software rendering).
Our research lab has been doing headless opengl rendering for about a year (you can see my related serverfault question here), and we found that the easiest thing was to just give users remote access to the server's local X-screen. The downsides: (a) giving remote access to the x-server is regarded by some as a bad security practice if done wrong, and (b) it opens a dummy window will pop up on the server's display, but if it's headless, this shouldn't matter. A few other options are described in the ServerFault link too, if you're interested.
You need an x-screen running on the server, and it should be noted that some video cards require a physical monitor to be attached if you want to start an x-screen. The NVidia driver lets you get around this using the ConnectedMonitor option in xorg.conf.. Another option I've used in the past is to the build a dummy monitor plug. that makes the system think there's a CRT monitor attached. There are probably other solutions.
Good Luck!
https://serverfault.com/questions/186805/remote-offscreen-rendering
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With