QaidVoid / Complete-Single-GPU-Passthrough

Single GPU VFIO Passthrough Guide
785 stars 38 forks source link

AMDGPU VGA supports reset, Audio does not #35

Closed biggestsonicfan closed 9 months ago

biggestsonicfan commented 11 months ago

I haven't tried a Single GPU passthrough since replacing my old 1080, so I thought I would give it a go as I am researching something which requires a bit more oomph with graphics in a Windows environment.

I had everything set up right and I would get into Windows, however shutting down I couldn't get back to Linux and had to RSEIUB every time. Scratching my head, I began to scour my logs for answers and came across this gem:

Gotchas Passing through a device that does not support resetting

When the virtual machine shuts down, all devices used by the guest are deinitialized by its OS in preparation for shutdown. In this state, those devices are no longer functional and must then be power-cycled before they can resume normal operation. Linux can handle this power-cycling on its own, but when a device has no known reset methods, it remains in this disabled state and becomes unavailable. Since Libvirt and Qemu both expect all host PCI devices to be ready to reattach to the host before completely stopping the virtual machine, when encountering a device that will not reset, they will hang in a "Shutting down" state where they will not be able to be restarted until the host system has been rebooted. It is therefore recommended to only pass through PCI devices which the kernel is able to reset, as evidenced by the presence of a reset file in the PCI device sysfs node, such as /sys/bus/pci/devices/0000:00:1a.0/reset.

The following bash command shows which devices can and cannot be reset.

My Graphics card IOMMUs are as follows:

IOMMU Group 29:
    0d:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c0)
IOMMU Group 30:
    0d:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller [1002:ab28]

Turns out 0d:00.0 supports reset but 0d:00.1 does not, which is a real head scratcher...

If I can't get back to Linux through a passthrough, there's no real sense in using the passthrough. Just wanted to weigh my options here.

EDIT: Apparently this is infamously known as the AMD Reset Bug

QaidVoid commented 11 months ago

Turns out 0d:00.0 supports reset but 0d:00.1 does not, which is a real head scratcher

I've the same result on NVIDIA GPU. So, audio device not supporting reset might not matter much..

stale[bot] commented 9 months ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.