You are not logged in.

#1 2020-04-03 22:02:01

newbie115
Member
Registered: 2014-04-13
Posts: 28

Qemu with OpenGL and nvidia or problems with libvirtd permissions

Hi.

First of all I'd like to say that this is my last NVidia graphics card and I have no idea what possessed me to buy it. I was seduced by the low temperatures and the small size of a GTX 1050 TI...

I'm attempting to launch a virtual machine with GPU acceleration enabled using virt-manager (virglrenderer).
To do so, I have set the graphics to virtio, enabled 3D acceleration, as well as set the display to spice with listen type set to none and OpenGL enabled.
As stated in many other places (e.g. here most recently: https://bbs.archlinux.org/viewtopic.php?id=249928 ), when enabling OpenGL on the spice display with an NVidia GPU, virt-manager displays a black screen. When you disable OpenGL, you lose the HW acceleration but the screen is back. This problem does not occur on any ATI card I had. I cannot check whether it works on nouveau because it's performance is so terrible with my GPU, I cannot even navigate my normal desktop environment let alone a virtualized one. Thus I am forced to use the proprietary driver.
My first question is: Has anyone succeeded in finding the source of the black screen problem?

For now I've decided on a workaround.
I have changed the display to sdl, and enabled OpenGL there. Unfortunately I just do not understand libvirtd's permission system. The created qemu process does not have access to direct rendering. The only way to get it to even start is to set +iglx in my X11 configuration. This allows qemu to start without instantly crashing, but as soon as the guest tries to access a graphics mode, it crashes with the following error:

gl_version 30 - compat profile
WARNING: running without ARB/KHR robustness in place may crash
No provider of glTexStorage2D found.  Requires one of:
    Desktop OpenGL 4.2
    GL_ARB_texture_storage
    OpenGL ES 3.0
    GL_EXT_texture_storage

I tried adding /dev/dri/renderD128 and /dev/dri/card0 to cgroup_device_acl in /etc/libvirt/qemu.conf but this changes nothing. It seems that the sandbox, that libvirtd creates prevents new X11 windows from accessing direct rendering and I have no idea how to undo this.
What can I do? Could someone with knowledge of the way libvirtd sandboxes qemu at least nudge me in the right direction?

Help, I have spent soo much time on this already and I'm out of ideas.

EDIT: Just to clarify, this is what should get printed by qemu if it could do direct dendering:

gl_version 45 - core profile enabled
GLSL feature level 430

and it does so when launched normally from terminal by me. It is fine for me to launch one of my VMs temporarily like this but I have many of them and this becomes really difficult to maintain without virt-manager.

Last edited by newbie115 (2020-04-04 10:55:12)

Offline

Board footer

Powered by FluxBB