QEMU/KVM VM in Virt-Manager is running with a black screen when OpenGL acceleration is turned on.


SEE ALL MY REPLIES BELOW, they are more specific.

I created a QEMU/KVM VM in Virt-Manager and installed Arch linux on it.
Everything is working perfectly fine except when I enable OpenGL support on Spice server.
I can SSH into the VM, so it is working just fine except the Spice server/video output.
(Also can control the VM with keyboard blindly see replies below)

All I get is this:

I also tried with other ISOs, configurations.
I searched quite a bit and found I am not the only one with this issue, but nobody knew how to fix it.
I also tried just with qemu in the terminal, same result.
(Can work with just qemu in terminal see replies below)

Thank you.


[filip@filip-linux ~]$ inxi -Fxxxz
System:    Host: filip-linux Kernel: 5.4.35-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: KDE Plasma 5.18.4 
           tk: Qt 5.14.2 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: Micro-Star model: B450 TOMAHAWK (MS-7C02) v: 1.0 serial: <filter> UEFI: American Megatrends 
           v: 1.D0 date: 11/07/2019 
CPU:       Topology: 6-Core model: AMD Ryzen 5 3600 bits: 64 type: MT MCP arch: Zen L2 cache: 3072 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 86424 
           Speed: 3600 MHz min/max: 2200/3600 MHz boost: enabled Core speeds (MHz): 1: 2626 2: 2151 3: 2200 4: 2199 5: 2077 
           6: 2199 7: 2199 8: 2200 9: 3050 10: 1957 11: 2094 12: 2199 
Graphics:  Device-1: NVIDIA GF108 [GeForce GT 630] vendor: ZOTAC driver: nvidia v: 390.132 bus ID: 26:00.0 chip ID: 10de:0f00 
           Display: x11 server: X.Org 1.20.8 driver: nvidia compositor: kwin_x11 resolution: 1366x768~60Hz 
           OpenGL: renderer: GeForce GT 630/PCIe/SSE2 v: 4.6.0 NVIDIA 390.132 direct render: Yes 
Audio:     Device-1: NVIDIA GF108 High Definition Audio vendor: ZOTAC driver: snd_hda_intel v: kernel bus ID: 26:00.1 
           chip ID: 10de:0bea 
           Device-2: Advanced Micro Devices [AMD] Starship/Matisse HD Audio vendor: Micro-Star MSI driver: snd_hda_intel 
           v: kernel bus ID: 28:00.4 chip ID: 1022:1487 
           Sound Server: ALSA v: k5.4.35-1-MANJARO 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI driver: r8169 v: kernel 
           port: f000 bus ID: 22:00.0 chip ID: 10ec:8168 
           IF: enp34s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
           IF-ID-1: docker0 state: down mac: <filter> 
           IF-ID-2: virbr0 state: down mac: <filter> 
           IF-ID-3: virbr0-nic state: down mac: <filter> 
Drives:    Local Storage: total: 2.05 TiB used: 59.84 GiB (2.8%) 
           ID-1: /dev/nvme0n1 vendor: A-Data model: SX8200PNP size: 238.47 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> 
           rev: SS0328D scheme: GPT 
           ID-2: /dev/sda vendor: Seagate model: ST2000DM008-2FR102 size: 1.82 TiB speed: 6.0 Gb/s rotation: 7200 rpm 
           serial: <filter> rev: 0001 scheme: GPT 
Partition: ID-1: / size: 29.40 GiB used: 24.72 GiB (84.1%) fs: ext4 dev: /dev/nvme0n1p5 
           ID-2: /home size: 68.40 GiB used: 35.10 GiB (51.3%) fs: ext4 dev: /dev/nvme0n1p6 
Sensors:   System Temperatures: cpu: 46.2 C mobo: N/A gpu: nvidia temp: 42 C 
           Fan Speeds (RPM): N/A gpu: nvidia fan: 52% 
Info:      Processes: 292 Uptime: 6h 53m Memory: 15.65 GiB used: 2.72 GiB (17.4%) Init: systemd v: 244 Compilers: gcc: 9.3.0 
           clang: 10.0.0 Shell: bash v: 5.0.16 running in: konsole inxi: 3.0.37

Which video adapter type are you using?

I am using Virtio with 3D acceleration. Virtio is required for that.

Have you install spice spice-gtk spice-vdagent celt0.5.1 on guest (archlinux)?
And do you have spice spice-gtk on host (manjaro)?

In Display Spice, choose listen to none.

Listen type was already set to none.
On host I had it all, on guest I installed all as suggested but it did not help.

I can use SSH to connect to it while it is running in virt-manager with a black screen, and do this:

[filip@arch ~]$ dmesg | grep drm
[    1.565935] [drm] pci: virtio-vga detected at 0000:00:01.0
[    1.565937] fb0: switching to virtiodrmfb from EFI VGA
[    1.566017] [drm] features: +virgl +edid
[    1.566406] [drm] number of scanouts: 1
[    1.566410] [drm] number of cap sets: 2
[    1.574356] [drm] cap set 0: id 1, max-version 1, max-size 308
[    1.574409] [drm] cap set 1: id 2, max-version 2, max-size 688
[    1.574565] [drm] Initialized virtio_gpu 0.1.0 0 for virtio0 on minor 0
[    1.592250] virtio_gpu virtio0: fb0: virtio_gpudrmfb frame buffer device

That means that on the guest side it is configured properly.
If I look in the virt manager log: VM Log file on PasteBin.

qemu-system-x86_64: warning: Spice: dcc.c:664:dcc_push_monitors_config: monitors_config is NULL
gl_version 33 - core profile enabled
qemu_spice_gl_scanout_texture: failed to get fd for texture

That seems to be the problem.

Probably you had two different display adapter drivers. (https://bbs.archlinux.org/viewtopic.php?id=243332)

This is my configuration:

I had an idea and did this:

  • Created an identical VM in virt-manager
  • Installed Fedora 32 on it
  • Switched to Opengl (Turned OpenGl on)
  • Blindly typed these commands into the terminal:
dmesg | grep drm >> drm.log
glxinfo | grep OpenGL >> glxinfo.log
  • Restarted without OpenGL and looked at the files:
    In drm.log I found the same output as when I SSHed into the Arch VM:

In glxinfo.log I did not find llvmpipe(software rendering) but "OpenGL renderer string: virgl", so that is working just fine.

OpenGL vendor string: Red Hat
OpenGL renderer string: virgl
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.0.5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 20.0.5
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

So the only problem should be the errors/warning reported inthe VM log at startup, though they are a little different in the Fedora VM: Fedora VM Log

qemu-system-x86_64: warning: Spice: dcc.c:664:dcc_push_monitors_config: monitors_config is NULL
gl_version 33 - core profile enabled
qemu_spice_gl_scanout_texture: failed to get fd for texture
vrend_renderer_fill_caps: Entering with stale GL error: 1280
GLSL feature level 330

My configuration looks just like yours.
The thread you linked though does not have any connection to my issue except that the one error line of the log file is same as mine.
But that must have been just a coincidence he was talking about a completely different problem and probably with the QXL video model, and had graphics output and did not mention any OpenGL/Spice acceleration.

1 Like

The only way I found that works for me with virgl 3D acceleration is to start a qemu VM with -display egl-headless,gl=on(gl=on can be omitted, it is automatic/implied):

sudo qemu-system-x86_64 -name Arch -drive file=/home/filip/VM/archlinux.qcow2 -m 8192 -enable-kvm -M q35 -cpu host -smp 12,sockets=1,cores=12,threads=1 -display egl-headless,gl=on -usb -device usb-tablet -bios /usr/share/ovmf/x64/OVMF_CODE.fd -boot order=c -device virtio-vga,virgl=on -spice unix,disable-ticketing,image-compression=off,addr=arch.sock,seamless-migration=on

Then connect to the unix socket with spice:

sudo remote-viewer spice+unix://arch.sock

And virgl 3D just works.


Technically with virt-manager it also works, I just have a black screen though (As I confirmed with Fedora).
Both virt-manager and virt-viewer are RedHat projects.
With virt-viewer in Spice mode it works but only if I start the VM in egl-headless mode.

If I tried -display spice-app,gl=on, no matter what I did it either did not work at all or just llvmpipe(software rendering, without gl=on). --That is exactly what is happening in virt-manager.

Should I report a bug/issue? But where/to who?

3 Likes

Did you managed to resolve the issue with virt-manager? I do have exactly the same problem and not only virt-manager but even qemu and remote-viewer gives me black screen. No error, no logs, nothing, just black screen. QXL works just fine.

No I did not resolve the issue I also tried virt tools and qemu mailing lists, again no help. The community let me down on this one.

1 Like

Hello,
In my PC with amdpgu, I have no problem with virt3dgl (opengl=on, 3d acc =on). But, on my other PC with an old NVIDIA graphic card (opengl =on, 3d =on) gave me an error.

Error starting domain: internal error: No DRM render nodes available

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
    self._backend.create()
  File "/usr/lib/python3.8/site-packages/libvirt.py", line 1152, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: internal error: No DRM render nodes available

But if opengl = off and 3d acc on, it works fine. :sweat_smile:

I've read this article:

I found that it depends on graphic card, etc.

Your other PC with older Nvidia gpu doesn't have drivers installed properly. That's why it doesn't work. But mine did and it worked, the problem was that video output was just a black screen.

1 Like

I'm having the same issue as well on regular Arch. Black screen with OpenGL and 3D Acceleration, boots just fine without OpenGL.

I did not resolve the issue. But for the record, could you please state what graphics card with what drivers are you using? (I mean on your host). Thanks.

On my host, I'm using an Nvidia GTX 1060 with the Nvidia 440.82 drivers.

I have the same problem as well as on the latest manjaro KDE.
For the record, I post my host information here.

System:
  Kernel: 5.6.15-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.1.0 
  Desktop: KDE Plasma 5.18.5 tk: Qt 5.14.2 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:
  Type: Laptop System: MECHREVO product: X7Ti Series v: N/A serial: <filter> 
  Mobo: MECHREVO model: X7Ti Series v: 0.1 serial: <filter> UEFI: American Megatrends 
  v: N.1.10 date: 11/21/2016 
Battery:
  ID-1: BAT0 charge: 26.2 Wh condition: 26.2/46.9 Wh (56%) volts: 11.3/10.9 
  model: standard type: Li-ion serial: <filter> status: Full 
Memory:
  RAM: total: 15.53 GiB used: 10.06 GiB (64.8%) 
  RAM Report: permissions: Unable to run dmidecode. Root privileges required. 
CPU:
  Topology: Quad Core model: Intel Core i7-6700HQ bits: 64 type: MT MCP 
  arch: Skylake-S rev: 3 L2 cache: 6144 KiB bogomips: 41621 
  Speed: 2260 MHz min/max: 800/3500 MHz Core speeds (MHz): 1: 2260 2: 1789 3: 2066 
  4: 1416 5: 2419 6: 2523 7: 1864 8: 2539 
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat arch_perfmon art avx avx2 
  bmi1 bmi2 bts clflush clflushopt cmov constant_tsc cpuid cpuid_fault cx16 cx8 de 
  ds_cpl dtes64 dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu 
  fsgsbase fxsr hle ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs ida intel_pt 
  invpcid invpcid_single lahf_lm lm mca mce md_clear mmx monitor movbe mpx msr mtrr 
  nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt 
  pse pse36 pti pts rdrand rdseed rdtscp rep_good rtm sdbg sep smap smep ss ssbd sse 
  sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust 
  tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt xsaves 
  xtopology xtpr 
Graphics:
  Device-1: Intel HD Graphics 530 vendor: Tongfang Hongkong Limited driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:191b 
  Device-2: NVIDIA GP106M [GeForce GTX 1060 Mobile] vendor: Tongfang Hongkong Limited 
  driver: nvidia v: 440.82 bus ID: 01:00.0 chip ID: 10de:1c20 
  Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia 
  alternate: fbdev,intel,nouveau,nv,vesa compositor: kwin_x11 
  resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa Intel HD Graphics 530 (SKL GT2) v: 4.6 Mesa 20.0.7 
  direct render: Yes 
Audio:
  Device-1: Intel 100 Series/C230 Series Family HD Audio 
  vendor: Tongfang Hongkong Limited driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
  chip ID: 8086:a170 
  Sound Server: ALSA v: k5.6.15-1-MANJARO 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Tongfang Hongkong Limited driver: r8169 v: kernel port: d000 bus ID: 02:00.0 
  chip ID: 10ec:8168 
  IF: enp2s0 state: down mac: <filter> 
  Device-2: Intel Wireless 7265 driver: iwlwifi v: kernel port: d000 bus ID: 03:00.0 
  chip ID: 8086:095a 
  IF: wlp3s0 state: up mac: <filter> 
  IP v4: <filter> type: dynamic noprefixroute scope: global broadcast: <filter> 
  IP v6: <filter> type: noprefixroute scope: link 
  IF-ID-1: docker0 state: down mac: <filter> 
  IP v4: <filter> scope: global broadcast: <filter> 
  IF-ID-2: virbr0 state: up speed: 10 Mbps duplex: unknown mac: <filter> 
  IP v4: <filter> scope: global broadcast: <filter> 
  IF-ID-3: virbr0-nic state: down mac: <filter> 
  IF-ID-4: vnet0 state: unknown speed: 10 Mbps duplex: full mac: <filter> 
  IP v6: <filter> scope: link 
  WAN IP: <filter> 
Drives:
  Local Storage: total: 2.07 TiB used: 100.54 GiB (4.8%) 
  ID-1: /dev/nvme0n1 vendor: Intel model: MEMPEK1W016GAL size: 13.41 GiB 
  speed: 15.8 Gb/s lanes: 2 serial: <filter> rev: K3110311 scheme: GPT 
  ID-2: /dev/sda vendor: A-Data model: IM2S3338-256GD size: 238.47 GiB speed: 6.0 Gb/s 
  serial: <filter> rev: 6A scheme: GPT 
  ID-3: /dev/sdb vendor: HGST (Hitachi) model: HTS541010A9E680 size: 931.51 GiB 
  speed: 6.0 Gb/s rotation: 5400 rpm serial: <filter> rev: A7J0 scheme: GPT 
  ID-4: /dev/sdc type: USB vendor: Seagate model: BUP Slim BK size: 931.51 GiB 
  serial: <filter> rev: 0304 scheme: GPT 
  Message: No Optical or Floppy data was found. 
RAID:
  Message: No RAID data was found. 
Partition:
  ID-1: / size: 149.51 GiB used: 100.50 GiB (67.2%) fs: btrfs dev: /dev/sdb5 
  label: N/A uuid: 0e879d08-c51a-47ac-870c-d3560b165a8d 
  ID-2: /boot/efi size: 499.7 MiB used: 572 KiB (0.1%) fs: vfat dev: /dev/sdb4 
  label: N/A uuid: 5567-008A 
  ID-3: /home size: 149.51 GiB used: 100.50 GiB (67.2%) fs: btrfs dev: /dev/sdb5 
  label: N/A uuid: 0e879d08-c51a-47ac-870c-d3560b165a8d 
  ID-4: /run/timeshift/backup size: 149.51 GiB used: 100.50 GiB (67.2%) fs: btrfs 
  dev: /dev/sdb5 label: N/A uuid: 0e879d08-c51a-47ac-870c-d3560b165a8d 
  ID-5: swap-1 size: 8.00 GiB used: 44.0 MiB (0.5%) fs: swap dev: /dev/nvme0n1p1 
  label: N/A uuid: 816df15d-013b-4192-aa81-8d5b87586ba8 
Unmounted:
  ID-1: /dev/nvme0n1p2 size: 5.41 GiB fs: ntfs label: N/A uuid: 3C961A77961A31BE 
  ID-2: /dev/sda1 size: 99.0 MiB fs: vfat label: N/A uuid: D881-9F79 
  ID-3: /dev/sda2 size: 128.0 MiB fs: ntfs label: N/A uuid: 0AB705CD0AB705CD 
  ID-4: /dev/sda3 size: 234.53 GiB fs: ntfs label: N/A uuid: AABC8341BC8306D3 
  ID-5: /dev/sda4 size: 636.0 MiB fs: ntfs label: N/A uuid: EAFC1C2DFC1BF295 
  ID-6: /dev/sda5 size: 652.0 MiB fs: ntfs label: N/A uuid: 86285357285344F9 
  ID-7: /dev/sda6 size: 637.0 MiB fs: ntfs label: N/A uuid: 1C30CC2F30CC11A6 
  ID-8: /dev/sda7 size: 980.0 MiB fs: ntfs label: N/A uuid: B68A8D9E8A8D5BAD 
  ID-9: /dev/sda8 size: 899.0 MiB fs: ntfs label: N/A uuid: D446DE4846DE2ACE 
  ID-10: /dev/sdb1 size: 120.00 GiB fs: ntfs label: N/A uuid: B002FD0902FCD4F6 
  ID-11: /dev/sdb2 size: 200.00 GiB fs: ntfs label: N/A uuid: 960E2A8F0E2A6907 
  ID-12: /dev/sdb3 size: 461.51 GiB fs: ntfs label: N/A uuid: 00343209343201E8 
  ID-13: /dev/sdc1 size: 931.51 GiB fs: ntfs label: Seagate uuid: CE4E801D4E800107 
USB:
  Hub: 1-0:1 info: Full speed (or root) Hub ports: 16 rev: 2.0 speed: 480 Mb/s 
  chip ID: 1d6b:0002 
  Device-1: 1-4:2 info: Acer HD Webcam type: Video driver: uvcvideo interfaces: 2 
  rev: 2.0 speed: 480 Mb/s chip ID: 5986:069e serial: <filter> 
  Device-2: 1-6:3 info: Intel type: Bluetooth driver: btusb interfaces: 2 rev: 2.0 
  speed: 12 Mb/s chip ID: 8087:0a2a 
  Device-3: 1-7:4 info: Logitech G203 Gaming Mouse type: Mouse,HID 
  driver: hid-generic,usbhid interfaces: 2 rev: 2.0 speed: 12 Mb/s chip ID: 046d:c084 
  serial: <filter> 
  Device-4: 1-9:5 info: Logitech Keyboard K120 type: Keyboard,HID 
  driver: hid-generic,usbhid interfaces: 2 rev: 1.1 speed: 1.5 Mb/s chip ID: 046d:c31c 
  Hub: 2-0:1 info: Full speed (or root) Hub ports: 8 rev: 3.0 speed: 5 Gb/s 
  chip ID: 1d6b:0003 
  Device-5: 2-1:2 info: Seagate RSS LLC Backup Plus Portable Drive type: Mass Storage 
  driver: uas interfaces: 1 rev: 3.0 speed: 5 Gb/s chip ID: 0bc2:ab24 serial: <filter> 
  Hub: 3-0:1 info: Full speed (or root) Hub ports: 2 rev: 2.0 speed: 480 Mb/s 
  chip ID: 1d6b:0002 
  Hub: 4-0:1 info: Full speed (or root) Hub ports: 2 rev: 3.1 speed: 10 Gb/s 
  chip ID: 1d6b:0003 
Sensors:
  System Temperatures: cpu: 67.0 C mobo: 51.0 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 332 Uptime: 59m Init: systemd v: 245 Compilers: gcc: 10.1.0 alt: 8 
  Shell: zsh v: 5.8 running in: konsole inxi: 3.0.37 

Forum kindly sponsored by