Opengl is not available

Hi, I’m trying to set up virtual machine with virtio through virt-manager but get some problem.

I’ve set up virt-manager using the following configurations:

virtualisation.libvirtd.enable = true;
virtualisation.libvirtd.qemu.swtpm.enable = true;
virtualisation.libvirtd.qemu.ovmf.enable = true;
virtualisation.libvirtd.qemu.ovmf.package = pkgs.OVMFFull;
services.acpid.enable = true;
environment.systemPackages = with pkgs; [
  virt-manager virt-viewer
  spice spice-gtk spice-vdagent spice-protocol
  win-virtio win-spice

The video of the VM is set to use virtio:

  <model type="virtio" heads="1" primary="yes">
    <acceleration accel3d="yes"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>

I have an Nvidia Qradro card. Hardware configurations are:

hardware.enableAllFirmware = true; = true;

services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.nvidiaSettings = true;
hardware.nvidia.nvidiaPersistenced = true;
hardware.nvidia.modesetting.enable = true;

hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
environment.systemPackages = with pkgs; [
  libGL libGLU
environment.variables = {
  LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:/run/opengl-driver/lib:/run/opengl-driver-32/lib";

However, when powering on the VM, error occurred with message

libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2022-02-16T02:06:46.531572Z qemu-system-x86_64: -device virtio-vga-gl,id=video0,max_outputs=1,bus=pcie.0,addr=0x1: opengl is not available

Did I miss something?

1 Like

Did you find a solution?