I cannot use the OpenGL 3d acceleration of virtio with qemu-kvm and virt-manager

Hey!
my inxi

System:
  Kernel: 6.1.7-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1-x86_64
    root=UUID=82f45c43-766a-4e30-8b27-a464d9dea722 rw quiet splash
    udev.log_priority=3
  Desktop: KDE Plasma v: 5.26.5 tk: Qt v: 5.15.8 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System:  v: 1.0
    serial: <superuser required>
  Mobo:  model:  v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: .316 date: 01/28/2021
Battery:
  ID-1: BAT0 charge: 36.2 Wh (100.0%) condition: 36.2/48.1 Wh (75.2%)
    volts: 12.5 min: 11.7 model:  type: Li-ion serial: N/A status: full
Memory:
  RAM: total: 7.2 GiB used: 3.19 GiB (44.4%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx bits: 64
    type: MT MCP arch: Zen/Zen+ note: check gen: 1 level: v3 note: check
    built: 2019 process: GF 12nm family: 0x17 (23) model-id: 0x18 (24)
    stepping: 1 microcode: 0x8108102
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 384 KiB desc: d-4x32 KiB; i-4x64 KiB L2: 2 MiB desc: 4x512 KiB L3: 4 MiB
    desc: 1x4 MiB
  Speed (MHz): avg: 1358 high: 1400 min/max: 1400/2100 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 1366 2: 1223
    3: 1400 4: 1400 5: 1400 6: 1400 7: 1275 8: 1400 bogomips: 33548
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
    bmi2 bpext clflush clflushopt clzero cmov cmp_legacy constant_tsc cpb
    cpuid cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid f16c
    flushbyasid fma fpu fsgsbase fxsr fxsr_opt ht hw_pstate ibpb irperf
    lahf_lm lbrv lm mca mce misalignsse mmx mmxext monitor movbe msr mtrr
    mwaitx nonstop_tsc nopl npt nrip_save nx osvw overflow_recov pae pat
    pausefilter pclmulqdq pdpe1gb perfctr_core perfctr_llc perfctr_nb
    pfthreshold pge pni popcnt pse pse36 rapl rdrand rdseed rdtscp rep_good
    sep sev sev_es sha_ni skinit smap smca smep ssbd sse sse2 sse4_1 sse4_2
    sse4a ssse3 succor svm svm_lock syscall tce topoext tsc tsc_scale
    v_vmsave_vmload vgif vmcb_clean vme vmmcall wdt xgetbv1 xsave xsavec
    xsaveerptr xsaveopt xsaves
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT vulnerable
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, STIBP:
    disabled, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: ASUSTeK
    driver: nvidia v: 470.161.03 alternate: nouveau,nvidia_drm non-free: 525.xx+
    status: current (as of 2022-12) arch: Turing code: TUxxx
    process: TSMC 12nm FF built: 2018-22 pcie: gen: 1 speed: 2.5 GT/s lanes: 8
    link-max: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:1f91
    class-ID: 0300
  Device-2: AMD Picasso/Raven 2 [Radeon Vega Series / Radeon Mobile Series]
    vendor: ASUSTeK driver: amdgpu v: kernel arch: GCN-5 code: Vega
    process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s lanes: 16 ports:
    active: eDP-1 empty: none bus-ID: 05:00.0 chip-ID: 1002:15d8 class-ID: 0300
    temp: 51.0 C
  Device-3: IMC Networks USB2.0 HD UVC WebCam type: USB driver: uvcvideo
    bus-ID: 3-1:2 chip-ID: 13d3:56a2 class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 21.1.6 compositor: kwin_x11 driver: X:
    loaded: amdgpu,nvidia unloaded: modesetting,nouveau alternate: fbdev,nv,vesa
    dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 mapped: eDP model: Najing CEC Panda 0x002d built: 2018
    res: 1920x1080 hz: 60 dpi: 142 gamma: 1.2 size: 344x194mm (13.54x7.64")
    diag: 395mm (15.5") ratio: 16:9 modes: max: 1920x1080 min: 640x480
  API: OpenGL v: 4.6 Mesa 22.3.3 renderer: AMD Radeon Vega 8 Graphics (raven
    LLVM 15.0.7 DRM 3.49 6.1.7-1-MANJARO) direct render: Yes
Audio:
  Device-1: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 8 link-max: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:10fa class-ID: 0403
  Device-2: AMD Family 17h/19h HD Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 05:00.6
    chip-ID: 1022:15e3 class-ID: 0403
  Sound API: ALSA v: k6.1.7-1-MANJARO running: yes
  Sound Server-1: JACK v: 1.9.21 running: no
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.64 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: e000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Realtek RTL8821CE 802.11ac PCIe Wireless Network Adapter
    vendor: AzureWave driver: rtw_8821ce v: N/A modules: rtw88_8821ce pcie:
    gen: 1 speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 04:00.0
    chip-ID: 10ec:c821 class-ID: 0280
  IF: wlp4s0 state: down mac: <filter>
  WAN IP: <filter>
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 476.94 GiB used: 36.37 GiB (7.6%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Micron model: 2200V MTFDHBA512TCK
    size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: P1MA0V4 temp: 42.9 C scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 476.64 GiB size: 468.09 GiB (98.21%) used: 36.37 GiB (7.8%)
    fs: ext4 dev: /dev/nvme0n1p2 maj-min: 259:2 label: N/A
    uuid: 82f45c43-766a-4e30-8b27-a464d9dea722
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 312 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1 label: N/A
    uuid: 2796-D0A7
Swap:
  Alert: No swap data was found.
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-4:2 info: IMC Networks Bluetooth Radio type: Bluetooth
    driver: btusb interfaces: 2 rev: 1.1 speed: 12 Mb/s power: 500mA
    chip-ID: 13d3:3530 class-ID: e001 serial: <filter>
  Hub-2: 2-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-3: 3-0:1 info: Hi-speed hub with single TT ports: 2 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 3-1:2 info: IMC Networks USB2.0 HD UVC WebCam type: Video
    driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA
    chip-ID: 13d3:56a2 class-ID: 0e02 serial: <filter>
  Hub-4: 4-0:1 info: Super-speed hub ports: 1 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 51.0 C mobo: N/A gpu: amdgpu temp: 51.0 C
  Fan Speeds (RPM): cpu: 2400
Info:
  Processes: 265 Uptime: 19m wakeups: 13665 Init: systemd v: 252
  default: graphical tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7
  Packages: pm: pacman pkgs: 1228 libs: 338 tools: pamac pm: flatpak pkgs: 0
  Shell: Zsh v: 5.9 default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.24

I’m trying to enable OpenGL 3d acceleration for a debian virtual machine, using VirtIO, I specified my Nvidia video card in the spice server settings. When I start vm with these settings it gives me this error:

Domain startup error: internal error: QEMU unexpectedly stopped monitor: qemu-system-x86_64: ../mesa-22.3.3/src/gallium/drivers/llvmpipe/lp_texture.c:638: llvmpipe_resource_get_handle: Assertion `lpr->dt' failed.

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup
    self._backend.create()
  File "/usr/lib/python3.10/site-packages/libvirt.py", line 1373, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: qemu-system-x86_64: ../mesa-22.3.3/src/gallium/drivers/llvmpipe/lp_texture.c:638: llvmpipe_resource_get_handle: Assertion `lpr->dt' failed.

I have this driver right now: video-hybrid-amd-nvidia-470xx-prime, version : 470.161.03

I tried to install all the drivers from this list:

> 0000:01:00.0 (0300:10de:1f91) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2021.11.04               false            PCI
video-hybrid-amd-nvidia-470xx-prime            2021.11.04               false            PCI
          video-nvidia            2021.11.04               false            PCI
    video-nvidia-470xx            2021.11.04               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:05:00.0 (0300:1002:15d8) Display controller ATI Technologies Inc:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2021.11.04               false            PCI
video-hybrid-amd-nvidia-470xx-prime            2021.11.04               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


But with all of them virt-manager gives this error when OpenGL 3D acceleration is enabled, and with the “video-nvidia” and “video-nvidia-470xx” drivers, I have a black screen, but I can use tty.

What can I do about it? Help enable OpenGL 3d acceleration for Debian guest.

If I haven’t listed the information needed to address my question, please post about it and I’ll add it, thank you!

*I’m not saying that the problem exactly is with the driver, I just wrote what I tried to do to solve the problem

It is a virtual machine.
Unless you are configuring and using GPU pass through
installing any real hardware driver inside the VM is pointless - the hardware there is virtualized, not the real thing.

I installed the nvidia driver on the manjaro host and not on the debian virtual machine

then I must have misunderstood you :man_shrugging:
It’s not clear to me what the problem and the goal is.
Someone else might know.

Hello @64781e9468efbce9118c :wink:

Guess you want to use VirGL with qemu? A so-called virtual GPU that uses capabilities of the GPU…

If so, then it will not work with NVIDIA. VirGL is part of mesa and not compatible with the proprietary NVIDIA driver. INTEL or AMD should work.

The goal is to run a virtual machine with OpenGL 3D acceleration, and the problem is that when I run it with these parameters, virt-manager gives an error, the code of which I pointed out in the thread

will it work if I put an open source driver for my Nvidia video card?

By the way, when I specify AMD in the SPICE server and start vm, I see grub, see the start screen, enter my login and password there, and then a black screen, but I can go into tty. Is there anything I can do about this?

Hi,
i got the same problem. :cry:

Switched from my old Radeon HD 5770 to a Nvidia GTX 970 couple of weeks ago and cant get qemu
running with spice/virgl 3d acceleration… I Tried both NVIDIA and nouveau (figuered it out how to use both drivers side by side and switchable in GRUB menu, which is nice :slight_smile: )
With the properitary NVIDIA driver i got an error for initialization of EGLstreaming and with nouveau
an error that qemu unexpecty closed the monitor.

I’m really desperate, so if somebody has an hint how to get 3d accelation with an linux guest running again, please share with us.

(Didn’t tried vGPU jet, because it sounds very confusing about licening)

Could you share the settings of the Display and Video in virtmanager?

For reference a situation that seems to do what you need. (Now I use AMD, but this worked with a nvidia GT something)

my setup

Spice server
image
Video
image

$ glxinfo | grep "direct rendering"                               
direct rendering: Yes

$  glxgears                                                      
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
295 frames in 5.0 seconds = 58.916 FPS
298 frames in 5.0 seconds = 59.541 FPS
301 frames in 5.0 seconds = 59.962 FPS