Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GPU passthrough and Nvidia driver issues

Featured Replies

So I've been experimenting with KVM and passthrough of an Nvidia 750ti, mouse, and keyboard, and have had some issues with Nvidia driver installation. Particularly with the <clock> node in the XML. This is the node in question which is put in by the KVM Manager plugin:

 

  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>

 

And here is my current XML for reference:

 

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>Win7Test</name>
  <uuid>b0a7b11b-c3b0-5825-fa80-34a773754676</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='3'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/SSD/KVM/Win7Test/Win7Test.qcow2'/>
      <target dev='hda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/Programs/Technet/en_windows_7_enterprise_with_sp1_x64_dvd_620201.iso'/>
      <target dev='hdc' bus='sata'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:79:71:2e'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc31c'/>
      </source>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc05a'/>
      </source>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.1,bus=pcie.0'/>
  </qemu:commandline>
</domain>

 

The latest Nvidia driver does not seem to like the <timer> settings in the <clock> node, so I changed this part:

 

  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>

 

to this:

 

  <clock offset='localtime'>
  </clock>

 

And then I don't seem to have any issues with the latest drivers.

 

Do I really need this <timer name='hypervclock' present='yes'/> for a stable Windows VM with GPU passthrough to game on? Or is there something else wrong with my XML that is causing Nvidia driver issues?

 

The problem I'm having is that the display adapter / drivers aren't installing correctly and show an error in the device manager. Doing a clean reinstall of the driver sometimes works but when I reboot, I either get the error again in the device manager or the Geforce Experience program crashes. Oddly, if I use an older driver, v340.52, I don't have this issue.

 

I'm not sure what that line is for but many seem to use it on their Windows VM's. I have this problem on both Win7 and Win10. Haven't tried a Win8 VM yet, but that is next on my list of things to try.

 

Gary

  • Author

Well, I guess I am just fine without those 2 <timer .../> lines. I played Battlefield 4 on it for about 30 minutes with the GPU passed through with 2 monitors hooked up for 3820 x 1080 goodness. It was stable and pretty fluid. I'm curious what the frame rate was, but I need a break. I'll play more later!

 

Gary

i have other issue, also related with nvidia driver

last good working for me are 340.32 for linux.

when i use any later driver i get issue like:

 

[    4.506044] nvidia: module license 'NVIDIA' taints kernel.

[    4.506047] Disabling lock debugging due to kernel taint

[    4.537462] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=none:owns=io+mem

[    4.538124] [drm] Initialized nvidia-drm 0.0.0 20150116 for 0000:01:00.0 on minor 0

[    4.538129] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  340.76  Thu Jan 22 12:11:08 PST 2015

[    4.807351] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:07.0/sound/card0/input7

[    4.807439] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:07.0/sound/card0/input8

[    4.969869] nvidia 0000:01:00.0: irq 33 for MSI/MSI-X

[    5.647775] NVRM: RmInitAdapter failed! (0x25:0x28:1197)

[    5.647781] NVRM: rm_init_adapter failed for device bearing minor number 0

[    5.647917] NVRM: nvidia_frontend_open: minor 0, module->open() failed, error -5

[  21.577924] random: nonblocking pool is initialized

[  21.962307] snd_hda_intel 0000:00:07.0: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj.

[  22.037798] kodi.bin[441]: segfault at 7f35fcdd96b8 ip 00007f35fcdd96b8 sp 00007fff6a749858 error 15

[  23.300040] nvidia 0000:01:00.0: irq 33 for MSI/MSI-X

[  23.644393] NVRM: RmInitAdapter failed! (0x25:0x28:1197)

[  23.644399] NVRM: rm_init_adapter failed for device bearing minor number 0

[  23.644531] NVRM: nvidia_frontend_open: minor 0, module->open() failed, error -5

[  53.859968] kodi.bin[461]: segfault at 7f5d807cc6b8 ip 00007f5d807cc6b8 sp 00007fffe550dd48 error 15

[  55.547591] nvidia 0000:01:00.0: irq 33 for MSI/MSI-X

[  55.888685] NVRM: RmInitAdapter failed! (0x25:0x28:1197)

[  55.888691] NVRM: rm_init_adapter failed for device bearing minor number 0

[  55.888822] NVRM: nvidia_frontend_open: minor 0, module->open() failed, error -5

[  86.036812] kodi.bin[480]: segfault at 7f8db12a36b8 ip 00007f8db12a36b8 sp 00007fff24c98918 error 15

[  87.800343] nvidia 0000:01:00.0: irq 33 for MSI/MSI-X

[  88.142973] NVRM: RmInitAdapter failed! (0x25:0x28:1197)

[  88.142979] NVRM: rm_init_adapter failed for device bearing minor number 0

[  88.143129] NVRM: nvidia_frontend_open: minor 0, module->open() failed, error -5

 

i dont know how this resolve, i can't use any new kernel because with this version, last working is 3.17

My card: Palit GT730

I have had some issues with passing through  my MSI GTX 970 to a Win8.1 and Win10 VM.

 

I can confirm that the code 43 seems to be an issue with the hypervclock timer at least during installation of the NVidia drivers. I have reinstated the timer after the drivers are installed and the code 43 does not reappear.

 

Currently I am not using the the hypervclock timer as I seem to get better results using the following

 

<clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>

 

My full xml (when running) for reference

 

SSD drive is set to use jonp's performance tweak  http://lime-technology.com/forum/index.php?topic=38569.0

 

<domain type='kvm' id='11' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>windows81nvidiaMSIRAW</name>
  <uuid>cc411d70-4463-4db7-bf36-d364c0cdaa3c</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>3906252</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>6</vcpu>
  <iothreads>6</iothreads>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='3'/>
    <vcpupin vcpu='2' cpuset='4'/>
    <vcpupin vcpu='3' cpuset='5'/>
    <vcpupin vcpu='4' cpuset='6'/>
    <vcpupin vcpu='5' cpuset='7'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
    <hap/>
    <kvm>
      <hidden state='on'/>
    </kvm>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='2' cores='8' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='directsync' io='native'/>
      <source file='/mnt/disk/vmdisk/Image Media/Win8.1ProN.raw'/>
      <backingStore/>
      <target dev='hda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/disk/vmdisk/Images/en_windows_8_1_n_x64_dvd_2707896.iso'/>
      <backingStore/>
      <target dev='hda' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/disk/vmdisk/Images/virtio-win-0.1-100.iso'/>
      <backingStore/>
      <target dev='hdd' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-3'/>
      <address type='drive' controller='0' bus='0' target='0' unit='3'/>
    </disk>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='sata0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb0'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb0'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb0'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x2'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:46:29:be'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.virtio-disk0.x-data-plane=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.1,bus=pcie.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:12.0,bus=root.1,addr=00.1,'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:12.2,bus=root.1,addr=00.2'/>
  </qemu:commandline>
</domain>

for further clarification here is a portion of Alex Williamson's blog which discusses code 43 errors when passing through Nvidia GPU's to Windows VM's

 

link to page

http://vfio.blogspot.ca/2014/08/vfiovga-faq.html

Question 10:

 

I'm assigning an Nvidia card to a Windows guest and get a Code 43 error in device manager.

 

Answer:

 

The Nvidia driver, starting with 337.88 identifies the hypervisor and disables the driver when KVM is found.  Nvidia claims this is an unintentional bug, but has no plans to fix it.  To work around the problem, we can hide the hypervisor by adding kvm=off to the list of cpu options provided (QEMU 2.1+ required).  libvirt support for this option is currently upstream.

 

Note that -cpu kvm=off is not a valid incantation of the cpu parameter, a CPU model such as host, or SandyBridge must also be provided, ex: -cpu host,kvm=off.

 

Update: The above workaround is sufficient for drivers 337.88 and 340.52.  With 344.11 and presumably later, the Hyper-V CPUID extensions supported by KVM also trigger the Code 43 error.  Disabling these extensions appears to be sufficient to allow the 344.11 driver to work.  This includes all of the hv_* options to -cpu.  In libvirt, this includes:

 

    <hyperv>

      <relaxed state='on'/>

      <vapic state='on'/>

      <spinlocks state='on' retries='8191'/>

 

    </hyperv>

 

and

 

  <clock offset='localtime'>

    <timer name='hypervclock' present='yes'/>

  </clock>

 

Unfortunately removing these options will impose a performance penalty as these paravirtual interfaces are designed to improve the efficiency of virtual machines.

  • Author

Thanks for the info. I just read your thread on it and will have a look at the blog too.

 

Gary

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.