3

I'm trying to run OpenGL on headless ubuntu server.

  • GPU / Driver : NVIDIA Geforce GTX 1080Ti / version 418.67
  • Using freeglut (installed by running apt install freeglut3-dev)
  • Using Xvfb (Since it is a headless server.)

When I run glxinfo | grep "OpenGL version", it says OpenGL version string: 3.1 Mesa 19.2.8. So, I am unable to run a code that requires OpenGL 3.3.

Since driver 418.67 is not latest, I could consider updating the driver, but I wanted to make sure if this could do something with Xvfb. Can using Xvfb can effect the driver and the OpenGL version it supports when I make a gl context with Xvfb running? Or it has nothing to do with it and only thing I can do is updating the driver?

Benno Straub
  • 2,268
  • 3
  • 19
  • 21
tink
  • 39
  • 1
  • 6

1 Answers1

3

Xvfb is an X server which whole purpose is to provide X11 services without having dedicated graphics hardware (i.e. a GPU). So it's the exact opposite of what you want.

Either don't use X11 at all and create a headless EGL OpenGL context: https://devblogs.nvidia.com/egl-eye-opengl-visualization-without-x-server/

Or use the "regular" Xorg server on the GPU without a display and input devices attached (you actually might want to disable automatic input device attachment in the configuration).

Personally I'd go with headless EGL.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • 2
    The code I want to run uses `glut`. (python `OpenGL.GLUT`). Is it possible to use headless EGL context easily with the code written with `glut`? Or could you point me to more information about the second option (regular Xorg server without display and input devices) ? Thank you for your response! – tink Mar 10 '20 at 05:34
  • What do I do if I don't have a GPU for a game? – bjcullinan Aug 15 '22 at 03:10
  • @bjcullinan I think I don't fully understand your question. Normally you'd want to run a game on a screen – and not in a headless environment at Xvfb is creating. If your remark is about running games without a GPU, then this the wrong question to address. Xvfb is meant for providing a graphical environment on systems that don't have display attach to at all (think servers, cloud VMs, stuff like that). – datenwolf Aug 15 '22 at 07:38