[SOLVED] AMD GPU Passthrough / Bad performance / Proxmox 9.1

uniketou

New Member
Dec 12, 2024
25
6
3
Hello all,

I've a fresh install of Proxmox 9.1 on a new server.
I've installed Windows 11 to have a gaming server.

But the performances are not good.
I've installed the latest AMD Driver ; GPU is correctly reconized in Windows.

=> Passmark : 4400 (I should have ~25 000)
3D => DirectX 11 : 0 points GPU Compute : 0 points !!!

Result : https://www.passmark.com/baselines/V11/display.php?id=307484749580

Battlefield 6 doesn't launch.

Server :

Motherboard : Asrock Rack RomeD8-2T
RAM : 128Go ECC
CPU : EPYC 7713
Graphic : AMD RX 9700XT

Do you see something wrong ? or I forgot something ?


I've followed the post #12 regarding the RX 9700 XT : https://forum.proxmox.com/threads/working-amd-rx-9070xt-support.163370/

BIOS :

Code:
Advanced → Chipset → Primary Graphics Adapter → Onboard (ASPEED)
Advanced → PCIe → Above 4G Decoding → Enabled
Advanced → PCIe → Re-size BAR support → Enabled
Advanced → IOH Configuration → IOMMU → Enabled
Advanced → IOH Configuration → ACS → Enabled
Advanced → IOH Configuration → ARI → Enabled


Below my proxmox settings :

VM :
Code:
agent: 1
args: -cpu host,-hypervisor,kvm=off, -smbios type=0,vendor="American Megatrends Inc.",version=3302,date="02/21/2024"
balloon: 0
bios: ovmf
boot: order=scsi0
cores: 16
cpu: host,hidden=1,flags=-md-clear;-pcid;-spec-ctrl;-ssbd;-ibpb;+virt-ssbd;+amd-ssbd;-amd-no-ssb;+pdpe1gb;+hv-tlbflush;+aes
efidisk0: VM_disk:vm-110-disk-4,efitype=4m,ms-cert=2023,pre-enrolled-keys=1,size=1M
hostpci0: 0000:83:00,pcie=1,x-vga=1,romfile=9070xt.rom
ide0: VM-images:iso/virtio-win-0.1.266.iso,media=cdrom,size=707456K
machine: pc-q35-10.1
memory: 32768
meta: creation-qemu=10.1.2,ctime=1763797120
name: Win-Gaming
net0: virtio=BC:24:11:A3:6E:2D,bridge=vmbr0,firewall=1
numa: 1
ostype: win11
scsi0: VM_disk:vm-110-disk-2,discard=on,iothread=1,size=120G,ssd=1
scsi1: SSD_GAMING:vm-110-disk-0,discard=on,iothread=1,size=1000G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=70fc09fe-8e2b-4a49-93b1-5484f67475f3,manufacturer=QVNVUw==,product=WjY5MC1JIEdBTUlORyBXSUZJ,family=WjY5MA==,base64=1
sockets: 1
tpmstate0: VM_disk:vm-110-disk-3,size=4M,version=v2.0
vmgenid: dddf957e-ea48-4e42-abd4-5c4c5649ba2f


GRUB :
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt pcie_acs_override=downstream,multifunction nofb nomodeset video=vesafb:off,efifb:off"


/etc/modules :

Code:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

/etc/modprobe.d/iommu_unsafe_interrupts.conf :
options vfio_iommu_type1 allow_unsafe_interrupts=1

/etc/modprobe.d/blacklist.conf :
Code:
blacklist nouveau
blacklist nvidia
blacklist nvidiafb
blacklist radeon
blacklist amdgpu

/etc/modprobe.d/vfio.conf :
options vfio-pci ids=1002:7550,1002:ab40 disable_vga=1

Windows :

devicemanager.jpg

amd.jpg
 

Attachments

  • devicemanager.jpg
    devicemanager.jpg
    20 KB · Views: 2
Last edited:
Your CPU is using "host" which is known to enable VBS within Windows, while more secure performance suffers quite a bit.
Check if under Windows Defender -> Device Security -> Core Isolation the Memory Integrity is activated and try to disable it.
Alternatively change the cpu type to something more generic like x86-64-v4, this will disable VBS within Windows and helps performance.

PVE 9.1 gained an option for
Code:
Fine-grained control of nested virtualization for VM guests.

    Some VM guest workloads need access to the host CPU's virtualization extensions for nested virtualization.
    Examples are nested hypervisors or Windows guests with Virtualization-based Security enabled.
    A new vCPU flag allows to enable nested virtualization on top of a vCPU type that corresponds to the host CPU vendor and generation.
    This can be an alternative to using the full host vCPU type
Maybe check that out too.

Unfortunately as far as i know BF6 Anticheat *requires* VBS / HVCI / Secure Boot / TPM so you will have to tinker around to get this working (if even possible).
 
Thank you MarkusKo ; Core Isolation is already in "OFF".

Regarding the CPU ; I see always "host" to have all CPU directly to the VM. I think we need to check on the Graphic card, no ?
 
Thank you for the sharing.

Do you run on Windows 11 VM with Proxmox ?

If yes, could you please share your Proxmox configuration ? + VM settings ?

I've installed a new Windows 11 VM with last drivers, I obtain 6500 points...

Does it impact if I run the Passmark with RDP ?
 
In the BIOS :

- CSM : enabled
- IOMMU enabled
- SR-IOV enabled
- PCIE ARI support enabled
-
4G decoding enabled

Here the last test with MAX value for the GPU :

testpass.jpg
 
Do you run on Windows 11 VM with Proxmox ?
Yes
If yes, could you please share your Proxmox configuration ? + VM settings ?

The following settings are currently in use.


Code:
args: -cpu host,hv_passthrough,-hypervisor,level=30,+vmx,guest-phys-bits=39 -global intel-iommu.aw-bits=39
balloon: 0
bios: ovmf
boot: order=ide0;ide1
cores: 20
cpu: host,flags=+pdpe1gb
efidisk0: zfs:vm-923-disk-0,efitype=4m,pre-enrolled-keys=1,size=1M
hookscript: local:snippets/rx9070_reset.sh
hostpci0: 0000:04:00,pcie=1,rombar=0,x-vga=1
hostpci1: 0000:83:00,pcie=1
hostpci2: 0000:01:00,pcie=1
ide0: none,media=cdrom
ide1: none,media=cdrom
machine: pc-q35-10.1,viommu=intel
memory: 49152
meta: creation-qemu=8.1.5,ctime=1718161181
name: etc1
net0: virtio=BC:24:11:49:FF:84,bridge=vmbr0,firewall=1,mtu=1,queues=2
net1: virtio=BC:24:11:D5:EB:D4,bridge=vmbr1,firewall=1,mtu=1,queues=2
numa: 0
onboot: 1
ostype: win11
rng0: source=/dev/urandom
scsi0: zfs:vm-923-disk-1,cache=writeback,discard=on,iothread=1,size=80G,ssd=1
scsi1: /dev/disk/by-id/wwn-0x5000cca08c028448,cache=writeback,iothread=1,size=3125616984K,ssd=1
scsihw: virtio-scsi-single
smbios1: ------
sockets: 1
tablet: 1
tags: default
tpmstate0: zfs:vm-923-disk-2,size=4M,version=v2.0
usb0: host=4-9.4
usb1: host=046d:c548
vga: none
vmgenid: -------
 
Last edited:
Does it impact if I run the Passmark with RDP ?
I haven't tried it with RD connection since I'm not using it, but I'll give it a shot later.

*I'm using nanokvm-pro and it's great. It runs with almost no loss.
 
The DirectX 11 test could not be run via RD connection, but everything else is functioning normally.

* It works fine via HDMI, but the reason is unknown.
* Enabling h264 support via RD connection has caused the score to drop further.

IMG_0446.jpeg
 
Last edited:
  • Like
Reactions: uniketou
Thank you uzumo ! I've figure out and find the issue !
It was coming from the RDP session...
When we log with RDP, Windows doesn't use the GPU for graphics...

The results with PassMark are still not good (I don't know why) ; but all games are running smootly !!! :) :)

One thing : I see that the CPU is still @2.00GHz... why the boost doesn't work ? do I need to modify the @arg on the VM Conf ?

Here the conf for the CPU :
Code:
args: -cpu host,kvm=off,-hypervisor,hv_vendor_id=whatever,hv_passthrough,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_time=on
cores: 12
cpu: host,hidden=1,flags=+pcid
vcpus: 12
sockets: 1
numa: 0

Here the GRUB :

GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt pcie_acs_override=downstream,multifunction nofb nomodeset video=vesafb:off,efifb:off"


clock.jpg

SOLUTION :

I've installed Apollo on the server (GIT : https://github.com/ClassicOldSong/Apollo )
it automatically install the Virtual display SudoMaker (needed because I don't have monitor connected).
=> On Apollo Settings > Audio/Video > Adapter Name : <put your GPU name> (ex: AMD Radeon RX 9700 XT)
=> Add registry key to force the virtual display to use the GPU :
Registry path \HKEY_LOCAL_MACHINE\SOFTWARE\SudoMaker\SudoVDA (create one if not exists):
  • gpuName [STRING]: The friendly name for the GPU which the virtual adapter connects to.


=> On the client :
- Install Moonlight : https://github.com/moonlight-stream/moonlight-qt
- Connect the client to the server (PIN Code)
- Connect on the "VIRTUAL Desktop" ; right click > Adapter ; make this screen as "Main"
 
Last edited:
  • Like
Reactions: ebiss and uzumo
One thing : I see that the CPU is still @2.00GHz... why the boost doesn't work ? do I need to modify the @arg on the VM Conf ?

You need to check the Proxmox VE host. I don't think the guest OS can actually check the clock speed of the physical cores.

We are allocating 12 cores from the total available cores, and this allocation is not fixed at a 1:1 ratio but is dynamic.

Code:
cat /proc/cpuinfo | grep MHz

GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt pcie_acs_override=downstream,multifunction nofb nomodeset video=vesafb:off,efifb:off"

This is unrelated, but some of the options you are using are not available in the current kernel.

 
Last edited:
  • Like
Reactions: uniketou
When I run this command on Proxmox, I can see some core up to the max boost value :

cat /proc/cpuinfo | grep MHz

clock2.jpg

So on the VM we need to stay at standard clock.


Regarding the GRUB configuration, do I need to update / correct it ?
 
One thing : I see that the CPU is still @2.00GHz... why the boost doesn't work ? do I need to modify the @arg on the VM Conf ?

The VM only "sees" the standard clock rate, but it's purely informational. You should see improved single core performance inside the VM.
 
  • Like
Reactions: uniketou
Even if you remove this, it will probably still work.

If it works either way, I personally would prefer to remove it.

It's up to you.

OK I'll test without these parameters.

What do you think about this ? (I found it for EPYC Proc) :

Code:
args: -smp '32,cores=8,threads=2,sockets=2,maxcpus=32' -cpu 'EPYC,topoext=on,l3-cache=on,+kvm_pv_unhalt,+kvm_pv_eoi,hv_vendor_id=NV43FIX,kvm=off,-hypervisor,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_reset,hv_vpindex,hv_runtime,hv_relaxed'

@KevinS : you mean, I'll see the Boost if I allocate only 1 Core ?
 
@KevinS : you mean, I'll see the Boost if I allocate only 1 Core ?
No, you will always only see 2Ghz inside the VM, because only the base clock is visible. I just mentioned "single core performance" because that is the main benefit of the turbo. You can check this by disabling and enabling the boost on the host and perform CPU benchmarking inside the VM.
 
Last edited:
OK unterstood :)

I've tested in game; all is fine ! CPU + GPU are working correctly with Moonlight !

Thank you for your help :)

testgame.jpg
 
  • Like
Reactions: uzumo