[SOLVED] GPU-passthrough issue, stuck at: dmesg | grep -e DMAR -e IOMMU

matthei

New Member
Aug 20, 2021
11
2
3
36
I've followed a youtube video, didn't work, and as I followed the wiki instructions slowly step by step I realized that the problem is that there's no DMAR-IOMMU output in dmesg.

If i try "dmesg | grep -i dmar" there's no output
If i try "dmesg | grep IOMMU" there's this output:
[ 1.059328] pci 0000:00:00.2: AMD-Vi: Unable to read/write to IOMMU perf counter.
[ 1.062734] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 5.423495] AMD-Vi: AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>



Things I've tried already:
- tried with PVE 7.0 and 6.4,
- cat /proc/cmdline seems to report correctly, the output is: BOOT_IMAGE=/boot/vmlinuz-5.4.106-1-pve root=/dev/mapper/pve-root ro quiet amd_iommu=on,
- i hope i got all the config in bios right: SVM mode enabled, IOMMU enabled (not just "auto", but "enabled")


Machine specs:
MB: Asrock Rack X470D4U2-2T with bios v P4.10
CPU: Ryzen7Pro 4750G
GPU: GeForce GTX 950

Any idea what else i can try? Thanks!
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
5,011
633
118
hi,

can you try adding iommu=pt in your cmdline? followed by updating initramfs and rebooting
 

leesteken

Famous Member
May 31, 2020
1,528
300
88
It would appear that your AMD IOMMU is working and enabled. On Ryzen systems, there is no output from grep -i dmar. This is normal. journalctl -b 0 | grep -i iommu will probably confirm this by showing Adding to iommu group lines. Are there other reasons that you think it is not enabled or working?
There is no need for amd_iommu=on (it is always on by default) or iommu=pt (it only sets a default identity mapping for devices that are not passed through) . Please do make sure the BIOS IOMMU setting is set to Enabled and not just Auto.
Check if there are multiple IOMMU groups with this command: for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU group %s ' "$n"; lspci -nnks "${d##*/}"; done. It will show which devices can be securely passed through (together per group, ignore PCI bridges).
 
  • Like
Reactions: oguz

matthei

New Member
Aug 20, 2021
11
2
3
36
Thanks for replying, I think that part is working now.. I got stuck in a loop between troubleshooting and bios options, and my main criteria was that this DMAR text would show up, hence why i thought it wasn't working. The VM boots up now, and the monitor shows the display, but i'm not quite in the clear yet.

What i get on the display is:
UEFI interactive shell v.2.2
EDK II...
Mapping tables:
...
Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
Shell>


I assume this is because I first installed windows using default VM settings, and then changed the bios type to UEFI and added an EFI disk, which is now not configured to boot properly. Is there a way to fix EFI with this shell, or would i have to reinstall windows?
I tried to tinker with this shell prompt, but the keyboard doesn't work - I did forward the USB device to the guest.
 

leesteken

Famous Member
May 31, 2020
1,528
300
88
I assume this is because I first installed windows using default VM settings, and then changed the bios type to UEFI and added an EFI disk, which is now not configured to boot properly. Is there a way to fix EFI with this shell, or would i have to reinstall windows?
Yes that is very likely. Windows does not handle such a change gracefully. The Microsoft documentation appears to assume that you prepare it beforehand. Hopefully, you can find a guide from someone who is more familiar with Windows.

EDIT: I would not be surprised if OVMF (the virtual UEFI shell) does not support USB input devices. Try using a virtual display and SPICE or NoVNC for fixing the boot issue.
 
Last edited:

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
5,011
633
118
I assume this is because I first installed windows using default VM settings, and then changed the bios type to UEFI and added an EFI disk, which is now not configured to boot properly. Is there a way to fix EFI with this shell, or would i have to reinstall windows?
yes, you have to reinstall windows with UEFI, i suggest making a clean VM and choosing OVMF during the setup, then follow the instructions on [0] or [1]

[0]: https://pve.proxmox.com/wiki/Pci_passthrough#GPU_OVMF_PCI_Passthrough_.28recommended.29
[1]: https://pve.proxmox.com/wiki/Pci_passthrough#GPU_OVMF_PCI_Express_Passthrough
 

matthei

New Member
Aug 20, 2021
11
2
3
36
OK, since it was a new VM i just deleted it and created a new one from scratch, with UEFI, and it all works now.
Typing this while looking at a screen, connected to a GPU, that's passed thru to the VM (along with USB devices).

Thank you for your help!
 
  • Like
Reactions: oguz and leesteken

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
5,011
633
118
great, please mark the thread as [SOLVED] by editing the title prefix :)
 

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 your own in 60 seconds.

Buy now!