5

I'm trying to use Xvfb, but it can't even run glxgears for some reason, and I don't know how to debug that, maybe I'm missing something. Here's the commands I'm using:

Xvfb :99 +extension GLX -screen 0 640x480x24
DISPLAY=:99 glxgears

And glxgears fails with the following error message:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  23
  Current serial number in output stream:  24

Edit: I've just asked a friend to run the same commands and it worked on his PC, but not on mine for some reason. Is there any way to debug X?

nullifiedcat
  • 73
  • 1
  • 5

2 Answers2

3

For anyone arriving at this question trying to use OpenGL on a headless server: you might get this message if you have NVIDIA GLX drivers installed but don't actually have an NVIDIA card in your server (e.g. if using the AWS Deep Learning Base AMI on a machine without a GPU).

To confirm, try running an X server with +iglx (which should allow glxinfo to run), and see whether glxinfo output (e.g. xvfb-run -s '-screen 0 1400x900x24 +iglx' glxinfo) reports client glx vendor string: NVIDIA Corporation. If it does, try switching to an AMI without any NVIDIA stuff.

2

You should use the mesa (with swrast engine) libgl for both your client (glxinfo) and server (xvfb).

On Debian 9 with both NVIDIA and mesa installed :

# LD_LIBRARY_PATH=/usr/lib/mesa-diverted/x86_64-linux-gnu Xvfb :99 +extension GLX -screen 0 640x480x24 & 
[1] 16936
# LD_LIBRARY_PATH=/usr/lib/mesa-diverted/x86_64-linux-gnu DISPLAY=:99 glxgears
6374 frames in 5.0 seconds = 1274.743 FPS 
^C

If you don't have an nvidia card, just uninstall nvidia drivers. If you wish to use mesa by default and keep nvidia installed, you can use glx-diversions

Hmlth
  • 21
  • 1