Problem configuring PCI for video output

jonathasra13

New Member
Jun 28, 2022
5
0
1
Hello,

I'm trying to make a configuration to release the HDMI video output to one of the configured virtual machines. I already made the settings below, following the tutorial link: https://pve.proxmox.com/wiki/Pci_passthrough

I already applied the settings

GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on" GRUB_CMDLINE_LINUX=""

and also

vfio vfio_ iommu_type1 vfio_pci vfio_virqfd

But when adding the PCI in the VM and trying to start the machine, I get the following error:


kvm: -device vfio-pci,host=0000:00:02.0,id=hostpci0,bus=pci.0,addr=0x10: vfio 0000:00:02.0: error getting device from group 1: Invalid argument Verify all devices in group 1 are bound to vfio-<bus> or pci-stub and not already in use TASK ERROR: start failed: QEMU exited with code 1

I feel like I'm forgetting something, could you help me?
 
Last edited:
can you post your iommu groups and the output of 'dmesg' ?
 
Is that the only GPU in your system?
Passthrough might not be able to work if the GPU is already in use by your PVE. In such a case it might be useful to blacklist the GPU drivers.
But then you won't be able to the local console anymore.
 
Last edited:
você pode postar seus grupos iommu e a saída de 'dmesg' ?

root@proxmox:~# dmesg | grep 00:02.0
[ 0.265932] pci 0000:00:02.0: [8086:3185] tipo 00 classe 0x030000
[ 0.265945] pci 0000:00:02.0: reg 0x10: [mem 0xa0000000-0xa0ffffff 64bit]
[ 0.265953] pci 0000:00:02.0: reg 0x18: [mem 0x90000000-0x9fffffff 64bit pref]
[ 0.265960] pci 0000:00:02.0: reg 0x20: [io 0xf000-0xf03f]
[ 0.265982] pci 0000:00:02.0: BAR 2: atribuído à efifb
[ 0.265989] pci 0000:00:02.0: Dispositivo de vídeo com ROM sombreada em [mem 0x000c0000-0x000dffff]
[ 0.279561] pci 0000:02:00.0: [8086:3165] tipo 00 classe 0x028000
[ 0.279598] pci 0000:02:00.0: reg 0x10: [mem 0xa1100000-0xa1101fff 64bit]
[ 0.279661] pci 0000:02:00.0: O Tamanho da Carga Máxima da ponte upstream definido para 128 (era 256, máximo 256)
[ 0.279669] pci 0000:02:00.0: Max Payload Size definido para 128 (foi 128, máximo 128)
[ 0.279788] pci 0000:02:00.0: PME# suportado do D0 D3hot D3cold
[ 0.286904] pci 0000:00:02.0: vgaarb: configuração como dispositivo VGA boot
[ 0.286904] pci 0000:00:02.0: vgaarb: dispositivo VGA adicionado: decodes=io+mem,owns=io+mem,locks=none
[ 0.286904] pci 0000:00:02.0: vgaarb: controle de ponte possível
[ 0.344516] pci 0000:00:02.0: Adicionando ao grupo Iommu 1
[ 0.344734] pci 0000:02:00.0: Adicionando ao grupo Iommu 12
[ 4.612536] vfio-pci 0000:00:02.0: vgaarb: alterado decodificados VGA: olddecodes=io+mem,decodes=io+mem:eek:wns=io+mem
[ 4.990100] iwlwifi 0000:02:00.0: dispositivo de habilitação (0000 -> 0002)
[ 4.998176] iwlwifi 0000:02:00.0: Destino encontrado de depuração: EXTERNAL_DRAM
[ 4.998184] iwlwifi 0000:02:00.0: Configuração de depuração encontrada: 0
[ 4.998644] iwlwifi 000:02:00.0: firmeware carregado versão 29.4063824552.0 7265D-29.ucode op_mode iwlmvm
[ 5.078544] iwlwifi 0000:02:00.0: Detectado Intel(R) Dual Band Wireless AC 3165, REV=0x210
[ 5.098406] iwlwifi 0000:02:00.0: Aplicação de destino de depuração EXTERNAL_DRAM
[ 5.100350] iwlwifi 0000:02:00.0: Alocados 0x00400000 bytes para monitor de firmware.
[ 5.105000] iwlwifi 0000:02:00.0: endereço base HW: 7c:70:db:5c:46:17
[ 5.294994] iwlwifi 0000:02:00.0 wlo1: renomeado de wlan0
 
É a única GPU do seu sistema?
O passthrough pode não ser capaz de funcionar se a GPU já estiver em uso pelo seu PVE. Nesse caso, pode ser útil colocar na lista negra os drivers de GPU.
Mas então você não será mais capaz de chegar ao console local.
I think that would be the right way for my friend.

When turning on proxmox the HDMI output login screen is displayed, when trying to "start" the VM the video stops but I get this error on the client. It seems to me to be this permission "conflict" to use PCI.

I'm configuring it on a Mini PC, it has two HDMI outputs, but only 1 GPU. I believe that, really, to have a VM on the video output, I will lose access to the local console.

Do you know how to configure the blacklist correctly?
 
Thats also described here: https://pve.proxmox.com/wiki/Pci_passthrough#PCI_Express_Passthrough
For starters, it's often helpful if the host doesn't try to use the GPU, which avoids issues with the host driver unbinding and re-binding to the device. Sometimes making sure the host BIOS POST messages are displayed on a different GPU is helpful too. This can sometimes be acomplished via BIOS settings, moving the card to a different slot or enabling/disabling legacy boot support.

First, find the device and vendor id of your vga card:

$ lspci -n -s 01:00
01:00.0 0300: 10de:1381 (rev a2)
01:00.1 0403: 10de:0fbc (rev a1)

The Vendor:Device IDs for this GPU and it's audio functions are therefore 10de:1381, 10de:0fbc.

Then, create a file:

echo "options vfio-pci ids=10de:1381,10de:0fbc" > /etc/modprobe.d/vfio.conf

blacklist the drivers:

echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf

and reboot your machine.
But in case oyu got a Intel iGPU you would need to blacklist another driver.
 
Thats also described here: https://pve.proxmox.com/wiki/Pci_passthrough#PCI_Express_Passthrough

But in case oyu got a Intel iGPU you would need to blacklist another driver.
my GPU is this:

00:02.0 VGA compatible controller [0300]: Intel Corporation GeminiLake [UHD Graphics 600] [8086:3185] (rev 06) (prog-if 00 [VGA controller])
DeviceName: Onboard - Video
Flags: fast devsel, IRQ 19, IOMMU group 1
Memory at a0000000 (64-bit, non-prefetchable) [size=16M]

Memory at 90000000 (64-bit, prefetchable) [size=256M]
I/O ports at f000
Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]

Capabilities: [40] Vendor Specific Information: Len=0c <?>
Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
Capabilities: [ac] MSI: Enable- Count=1/1 Maskable- 64bit-
Capabilities: [d0] Power Management version 2
Capabilities: [100] Process Address Space ID (PASID)
Capabilities: [200] Address Translation Service (ATS)
Capabilities: [300] Page Request Interface (PRI)
Kernel driver in use: vfio-pci
Kernel modules: i915
 

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!