Jump to content
robcalewar

win10 VM using gpu passthrough has no hdmi audio

6 posts in this topic Last Reply

Recommended Posts

Posted (edited)

Hi, I'm running unraid 6.7.2, QEMU 3.1.0, and libvirt 5.1.0.

 

I have a VM running windows 10 with a Geforce GTX 980 passed through at 4k and running great, except audio. I get no audio output at all but windows still detects an audio output device and acts as if everything is working normally.

 

I have tried the MSI fix with no such luck. I reinstalled nvidia drivers with the clean install option checked. I followed SpaceInvaderOne's youtube tutorial on getting this setup. I am using OVMF and Q35 3.1. I came across this reddit thread that almost explains my problem perfectly; LINK HERE, except different from the OP [in the referenced reddit post], I do have a volume slider. I added the "multifunction='on'" referenced by OP in this reply but my problem persists.

 

Here is the my current XML;

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm'>
  <name>Windows 10</name>
  <uuid>9094e21f-30d7-79e3-0b27-fd766c13326f</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>12582912</memory>
  <currentMemory unit='KiB'>6815744</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='12'/>
    <vcpupin vcpu='2' cpuset='5'/>
    <vcpupin vcpu='3' cpuset='13'/>
    <vcpupin vcpu='4' cpuset='6'/>
    <vcpupin vcpu='5' cpuset='14'/>
    <vcpupin vcpu='6' cpuset='7'/>
    <vcpupin vcpu='7' cpuset='15'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-3.1'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/9094e21f-30d7-79e3-0b27-fd766c13326f_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='4' threads='2'/>
  </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/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/disks/Samsung_SSD_850_EVO_1TB_S3PJNF0JB02123E/Windows 10/vdisk1.img'/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <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='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x8'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x9'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0xa'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0xb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
    </controller>
    <controller type='pci' index='6' model='pcie-to-pci-bridge'>
      <model name='pcie-pci-bridge'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:11:f5:0d'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='2'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <sound model='ich9'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
    </sound>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x83' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x83' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc52b'/>
      </source>
      <address type='usb' bus='0' port='1'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x056a'/>
        <product id='0x033c'/>
      </source>
      <address type='usb' bus='0' port='3'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x062a'/>
        <product id='0x4101'/>
      </source>
      <address type='usb' bus='0' port='4'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'/>
</domain>

 

Here is the referenced GPU listed in my Unraid > Tools > System Device;

IOMMU group 33:	[10de:13c0] 83:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 980] (rev a1)
                [10de:0fbb] 83:00.1 Audio device: NVIDIA Corporation GM204 High Definition Audio Controller (rev a1)

 

Can someone help me get hdmi audio output working?

 

Thanks in advance!

Edited by robcalewar

Share this post


Link to post

Seems like you've tried most of the obvious.

 

Does it work bare metal? And if so, have you tried a different VM OS?

Share this post


Link to post
Posted (edited)
11 minutes ago, scorcho99 said:

Seems like you've tried most of the obvious.

 

Does it work bare metal? And if so, have you tried a different VM OS?

I have confirmed that the GPU is capable of outputting sound by installing it in another computer [with a completely different components]. Previous to me creating this VM that we are currently talking about, I had another VM created and that was using hdmi video & audio working well but the VM was unintentionally scrapped due to some array issues on unraid.

 

In regards to another VM os, what good would that do? Is that just to create a new config and see what differences their are from my current xml?

Edited by robcalewar

Share this post


Link to post
21 hours ago, robcalewar said:

I have confirmed that the GPU is capable of outputting sound by installing it in another computer [with a completely different components]. Previous to me creating this VM that we are currently talking about, I had another VM created and that was using hdmi video & audio working well but the VM was unintentionally scrapped due to some array issues on unraid.

 

In regards to another VM os, what good would that do? Is that just to create a new config and see what differences their are from my current xml?

When I'm stuck I just start to try isolating. Sounds like the hardware works so that's not it. And you had a VM config working before, so it must be the VM configuration or the OS. My thought on trying a different OS is that if you got it to work with the same VM config you'd know it was the OS configuration that you needed to attack.

Share this post


Link to post

ah gotcha. I spun up another Win10 VM last night with no such luck. I'll give it ubuntu a try later today. thanks for the reply!

Share this post


Link to post

So to update on this; I finally got sound working. I created a new VM with nearly identical specifications to my original post. For a GPU I left it on VNC. I once all necessary drivers were installed I powered off the VM, added my GTX 980 as a second display with the BIOS [obtained through the method demonstrated in SpaceInvaderOne's video], and I set the audio device as my GTX 980. I booted up my VM and installed the latest version of my GPU drivers. After another reboot I have sound!! I pointed to the old vhd, windows 10 did some install process that took ~5m and everything is working smoothly. I have yet to disable the second [VNC] display but I don't imagine this being a problem at all.

 

Thanks scorcho99 and SpaceInvaderOne.

 

If anyone comes across this problem [or a similar one], something I've noticed is when people get weird hardware issues like this is the common fix seems to be spin up a new vm and sometimes a fresh config is the simplest solution to getting problems resolved. Once you've got your hardware over then switch over the VHD paths.

 

And purely for future diagnostic purposes; I have attached my working XML file;

 

 

New Win10VM.txt

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.