GPU Passthrough for an AMD system

ocrate

New Member
Oct 24, 2024
1
0
1
Yes, this is another GPU passthrough help request...

I've been trying to get this to work for hours over multiple days, and for the life of me I cannot get it to work. I've followed the official documentation, read and watched several guides/tutorials and a whole bunch of forum posts both here and other places.

I was really hoping I could get this to work. The idea is that I have a secondary computer that functions both as a server for hosting various software and as a secondary gaming machine connected to my TV. Running Proxmox with GPU passthrough seemed like the ideal option so that I could keep my gaming machine logically separated from all the other stuff, and allows me to run Home Assistant OS instead of the Docker variant.

Now before I give up and go back to just running plain old Linux I really hope that someone might be able to help me out.

Here are my specs
  • ASUS TUF Gaming B650-PLUS WIFI
  • AMD Ryzen 9 7900X
  • Asus TUF Gaming Radeon RX 7800 XT OC
I am running Proxmox 8.2.7 with Linux 6.8.12-2-pve kernel.

I've made sure IOMMU is enabled, and that CMS is disabled, in the BIOS. Later I've also tried disabling higher than 4G decoding as per some suggestion I read somewhere.

Output of dmesg | grep -e IOMMU:
Code:
[    0.379094] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
[    0.408686] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).

Output of dmesg | grep 'remapping'
Code:
[    0.382141] AMD-Vi: Interrupt remapping enabled

Relevant output from lspci -nn
Code:
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 32 [Radeon RX 7700 XT / 7800 XT] [1002:747e] (rev c8)
03:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 HDMI/DP Audio [1002:ab30]

The pvesh get command shows that my gpu (per device id 0000:03:00.0 name is not mentioned in the output) is in it's own iommugroup (group 14). Even separate from the audio controller (which is in group 15) .


Configuring the host

Now for the configuration of the host I've tried a lot of different settings and combination of settings. For starters I tried following the documentation and all the other guides that seemed to do the same.


Updating /etc/default/grub
Code:
# Initial attempt. I later found out that iommu is on by default and that some of these parameters are unnecessary.
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt video=vesafb:off video=efifb:off"
GRUB_CMDLINE_LINUX=""

# Later I tried this instead as per some post here on the forum
GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt initcall_blacklist=sysfb_init"
GRUB_CMDLINE_LINUX=""

Blacklisting drivers /etc/modprobe.d/blacklist.conf
Code:
blacklist amdgpu
blacklist radeon

Adding vfio modules in /etc/modules
Code:
 vfio
 vfio_iommu_type1
 vfio_pci
 vfio_virqfd # only found out much later that I didn't need this one

And finally configuring early loading in /etc/modprobe.d/vfio.conf
Code:
# This is the option I originally tried
options vfio-pci ids=1002:747e,1002:ab30 disable_vga=1

# I also tried something like this later on
options vfio-pci ids=1002:747e,1002:ab30
softdep amdgpu pre: vfio-pci

Naturally the configurations were reloaded using update-grub and update-initramfs -u before rebooting.


Setting up the VM

I've tried running both Windows 11 and arch linux for the guest OS. Both with very similar setups.
16G of RAM
8 Cores (CPU as host)
OVMF
q35
The rest is pretty much the default

Then I added my 7800XT using raw device and finding the aforementioned id 0000:03:00 and selecting All Functions.
Note that I did not initially select Primary GPU or PCIe. I tried that later, but I will get back to that.


Results

So initially I would see the Poxmox Boot menu on my TV that was plugged into the 7800 XT via HDMI, and the screen after that, but it froze at that point before getting to the actual TTY and login screen. If I started the VM from the web interface the screen would go black (meaning the frozen text disappeared) and notrhing more happened. After a minute or so the computer would restart by itself. Presumably after crashing. There was no ouput on the VNC either in the browser.

This is the behavior I see if I try any setting that involves blacklisting the GPU. Any combination I've tried has resulted in the same behavior. No output on either the connect screen or the terminal in the browser, and the eventual reboot after a minute or two.

After a lot of trial and error, as well as reading, I saw a post saying that the GPU should be able to reset just fine and that the blacklisting actually was not necessary. After that I tried removing much of the configuration I've done and essentially ending up back in the state I had before starting. So no blacklisting, no vfio modules or settings specified.

Now when I boot any of the two VMs I actually do get some ouput in the browser, but not on the screen connected via HDMI (I left the raw device mapping). Like before the TV goes black the minute I start a VM with the GPU mapped into it as a raw device. But I was able to install both the Arch and WIndows VMs (not at the same time of course). And I was able to install the 7800 XT driver in Windows, but as I've seen with many others, I do get the error 34 message. At least it seems like it recognized that the card is there.
After this I've tried using the PCIe option and Primary GPU both separately and together. What always happens is that the VM would freeze on the Proxmox boot screen or simply just stay black in the browser console window (still no output to the TV).


Some final comments


I have not tried mounting the GPU in another slot. It is currently mounted in the top slot.

I still have my RTX 3080 laying around. I could have tested with that one as well, but I have not yet done that. Let me know if you think that would be a good idea.

Any logs or other things you'd want me to provide please let me know as I'm not entirely sure what would be good to include.


Any help or suggestions would be much appreciated. Thanks.
 
Can you try add nomodeset into GRUB_CMDLINE_LINUX_DEFAULT?
I'll double check my settings later. Most the setup looks good in your settings.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!