Skip to content

Failed to use sdl graphics with nvidia drivers

Software environment

  • Operating system: Manjaro Linux
  • Architecture: x86_64
  • kernel version: 5.13.11-1-MANJARO
  • libvirt version: libvirtd (libvirt) 7.6.0
  • Hypervisor and version: QEMU emulator version 6.0.0
  • Nvidia drivers: 470.63.01

Description of problem

When I try to run virtual machine using libvirt with sdl graphics on laptop with NVidia graphics, qemu process crashes with following error:

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

But when I run it on AMD integrated graphics everything works fine. Also when I launch qemu manualy using sudo -E qemu-system-x86_64 -display sdl,gl=on everything works too.

Steps to reproduce

  1. Use NVidia GPU
  2. Create virtual machine with SDL graphics instead of spice
  3. Add display to it <graphics type="sdl" display=":0">
  4. Disable x11 auth xhost +; (do not forget to enable it later)
  5. Try to launch virtual machine

Additional information

Virtual machine log Glxinfo output

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information