Leoyzen / KVM-Opencore

Opencore Configuration of KVM Hackintosh with tweaks
GNU General Public License v3.0
450 stars 160 forks source link

DP/HDMI audio not work when using GPU passthrough. #2

Open Leoyzen opened 4 years ago

Leoyzen commented 4 years ago

Many peoples feedback that theirs DP/HDMI would not work when using GPU passthrough. It is a common mistake that newbies would made but there is little discussion in the net. You must put the graphic and graphic audio in the the bus but different function when passthrough them.

<!-- Assume we have a graphic(gfx(0x2d/0x0) and audio(0x2d/0x1)) -->
<hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x0'/>
    </source>
<!-- we put gfx under bus 0x01 and function 0x0, also with multifunction on. -->
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0' multifunction='on'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x2d' slot='0x00' function='0x1'/>
    </source>
<!-- we put graphic audio under the same bus 0x01 with gfx but different function 0x1-->
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
</hostdev>
Leoyzen commented 4 years ago

Apple and Lilu/AppleALC will find the audio device along with graphic(in ioreg, they are in the bus but different function), so if you are not set it correctly, you will not get a working HDMI/DP audio. Also noted this will break on-board audio too(AppleALC will confuse which one is truely the on-board audio)