Passthrough with vfio does not work : Debian freezes on boot

5 risposte [Ultimo contenuto]
Ritratto di marietto2008
marietto2008
(Newbie)
Offline
Newbie
Iscritto: 07/09/2008
Messaggi: 4

Hello.

I'm trying to enable the passthrough on my graphic card (nvidia RTX 2080 ti on CPU I9 - 9900k) on the debian 10,following this tutorial :

https://passthroughpo.st/gpu-debian/

These are the commands that I gave :

added this line : vfio_pci ids= 10de:1e04,10de:10f7 to this file : /etc/initramfs-tools/modules

below you can see how I have got that numbers :

ziomario@DESKTOP-N9UN2H3:/home/mariozio# lspci -nn | grep 01:00.

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti] [10de:1e04] (rev a1)01:00.1 Audio device [0403]: NVIDIA Corporation TU102 High Definition Audio Controller [10de:10f7] (rev a1)

and then I did : update-initramfs -uupdate-initramfs -u -k all

and I have added these lines :

blacklist nouveau
options nouveau modeset-0

to this file : /etc/modprobe.d/blacklist.conf

the tutorial does not explain if I should modify also the file /etc/default/grub. Anyway I tried,adding this line :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on iommu=pt"

instead of the old one,that was : GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and then I did again : update-initramfs -uupdate-initramfs -u -k all

but the result does not change. During the boot I see the blinking cursor hanging on the screen and nothing happens anymore. I have even removed all the changes that I made and I did again :

update-initramfs -uupdate-initramfs -u -k all

to understand what's the problem and I seen that if I add this line : vfio_pci ids= 10de:1e04,10de:10f7

and then I reboots the machine,it freezes.

maybe is useful if u read here :

mariozio@DESKTOP-N9UN2H3:/home/mariozio# dmesg | grep -e DMAR

[ 0.006554] ACPI: DMAR 0x00000000393A0E98 0000A8 (v01 ALASKA A M I 00000002 01000013)
[ 0.163834] DMAR: IOMMU enabled
[ 0.222182] DMAR: Host address width 39
[ 0.222182] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[ 0.222185] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 19e2ff0505e
[ 0.222185] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[ 0.222187] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[ 0.222188] DMAR: RMRR base: 0x0000003988e000 end: 0x00000039ad7fff
[ 0.222188] DMAR: RMRR base: 0x0000003b000000 end: 0x0000003f7fffff
[ 0.222189] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1
[ 0.222189] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[ 0.222190] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.223606] DMAR-IR: Enabled IRQ remapping in x2apic mode
[ 1.263105] DMAR: No ATSR found
[ 1.263138] DMAR: dmar0: Using Queued invalidation
[ 1.263179] DMAR: dmar1: Using Queued invalidation
[ 1.263426] DMAR: Hardware identity mapping for device 0000:00:00.0
[ 1.263427] DMAR: Hardware identity mapping for device 0000:00:01.0
[ 1.263469] DMAR: Hardware identity mapping for device 0000:00:02.0
[ 1.263470] DMAR: Hardware identity mapping for device 0000:00:12.0
[ 1.263471] DMAR: Hardware identity mapping for device 0000:00:14.0
[ 1.263471] DMAR: Hardware identity mapping for device 0000:00:14.2
[ 1.263472] DMAR: Hardware identity mapping for device 0000:00:16.0
[ 1.263472] DMAR: Hardware identity mapping for device 0000:00:17.0
[ 1.263473] DMAR: Hardware identity mapping for device 0000:00:1b.0
[ 1.263473] DMAR: Hardware identity mapping for device 0000:00:1c.0
[ 1.263474] DMAR: Hardware identity mapping for device 0000:00:1d.0
[ 1.263474] DMAR: Hardware identity mapping for device 0000:00:1f.0
[ 1.263475] DMAR: Hardware identity mapping for device 0000:00:1f.3
[ 1.263475] DMAR: Hardware identity mapping for device 0000:00:1f.4
[ 1.263476] DMAR: Hardware identity mapping for device 0000:00:1f.5
[ 1.263477] DMAR: Hardware identity mapping for device 0000:00:1f.6
[ 1.263478] DMAR: Hardware identity mapping for device 0000:01:00.0
[ 1.263479] DMAR: Hardware identity mapping for device 0000:01:00.1
[ 1.263480] DMAR: Hardware identity mapping for device 0000:01:00.2
[ 1.263480] DMAR: Hardware identity mapping for device 0000:01:00.3
[ 1.263481] DMAR: Setting RMRR:
[ 1.263481] DMAR: Ignoring identity map for HW passthrough device 0000:00:02.0 [0x3b000000 - 0x3f7fffff]
[ 1.263481] DMAR: Ignoring identity map for HW passthrough device 0000:00:14.0 [0x3988e000 - 0x39ad7fff]
[ 1.263482] DMAR: Prepare 0-16MiB unity mapping for LPC
[ 1.263482] DMAR: Ignoring identity map for HW passthrough device 0000:00:1f.0 [0x0 - 0xffffff]
[ 1.263529] DMAR: Intel(R) Virtualization Technology for Directed I/O
[ 16.610522] DMAR: 32bit 0000:01:00.0 uses non-identity mapping

Do u have some suggestion ? thanks.

Ritratto di homeless
homeless
(Guru)
Offline
Guru
Iscritto: 21/10/2011
Messaggi: 1453

Perché scrivi in inglese in un forum italiano ?

Quante schede grafiche hai e quale scheda grafica lasci attiva per il sistema ?

Ritratto di marietto2008
marietto2008
(Newbie)
Offline
Newbie
Iscritto: 07/09/2008
Messaggi: 4

Ciao,ho scritto in inglese perché ho posto la stessa domanda anche in diversi forum in lingua inglese e ho fatto copia incolla. Ho due schede grafiche,queste :

00:02.0 Display controller: Intel Corporation Device 3e98 (rev 02)

01:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti] (rev a1)
01:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
01:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Controller (rev a1)
01:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU102 UCSI Controller (rev a1)

avevo pensato di passare la scheda nvidia. Ma sto avendo problemi. Sarebbe più facile se passassi l'altra ? che differenza fa ? Ti spiego. Io volevo usare Linux come os principale,perche' e' + leggero e sicuro di Windows,sia per la protezione dai virus,sia perché io faccio grafica in 3D e ho visto che Blender va meglio di Windows sia come funzionamento che come rendering. Pero' Io uso altri software,come ICLONE,character creator 3,Daz. Iclone e CC3 non vanno bene con linux. Ci andrebbero,ma con wine sono instabili e perdono in performances. La maggiorparte dei software che uso vanno meglio con Windows. Anche blender,alla fine va abbastanza bene con windows. allora ho pensato di tenere la scheda video secondaria per linux e la RTX 2080 ti la passo sulla macchina virtuale. Lo scopo e' quello di avere un so host stabile e meno soggetto a beccarsi i virus. E per questo protegge l'altro,windows. Se facessi il contrario,windows si infetterebbe + facilmente e questo porterebbe anche la macchina virtuale con linux a crollare.

Ritratto di homeless
homeless
(Guru)
Offline
Guru
Iscritto: 21/10/2011
Messaggi: 1453

Ciao

Potresti meglio indicare nella macchina virtuale che desideri realizzare qual'è il sistema operativo installato per l'host (presumo Debian GNU/Linux) e quello per il guest (presumo Windows) ?

Puoi indicare il produttore e modello del computer utilizzato ?

Puoi indicare le URL alle discussioni negli altri forum dove hai posto il quesito (per seguire le risposte che hanno fornito) ?

Il Debian Wiki a tal proposito indica all'indirizzo https://wiki.debian.org/VGAPassthrough:

Citazione:

Prerequisites overview

You will need a Debian at least Wheezy. Your CPU should support virtualization and IOMMU (not supported by K variant of Intel CPUs). You need two distinct GPUs that can be used at the same time (Optimus cards won't work). The guest will output its display directly from the connected monitor (not visible from the host!), so you need two monitors or one with two inputs (one plugged into your host GPU, one into your guest GPU). You need a separate keyboard and mouse for the guest only (they are exclusively used by the guest) OR you could use device-sharing solutions like VNC or Synergy.


La tua configurazione rispetta questi requisiti ?

Ritratto di marietto2008
marietto2008
(Newbie)
Offline
Newbie
Iscritto: 07/09/2008
Messaggi: 4

OS host = debian 10
OS guest VM = windows 10

il mio pc gira con una CPU intel i9-9900k e una scheda madre gigabyte aorus pro. ho gia' controllato e supporta la virtualizzazione e IOMMU. Ho due schermi e due schede video. E due mouse e due tastiere.

Si,ho fatto la stessa domanda qui : http://forums.debian.net/viewtopic.php?f=7&t=143865

Ritratto di homeless
homeless
(Guru)
Offline
Guru
Iscritto: 21/10/2011
Messaggi: 1453

marietto2008 ha scritto:

il mio pc gira con una CPU intel i9-9900k [..] ho gia' controllato e supporta la virtualizzazione e IOMMU


Non dubito che supporti la virtualizzazione, ma potresti inviare il riferimento al sito intel dove è indicato il supporto per IOMMU ?

marietto2008 ha scritto:

Si,ho fatto la stessa domanda qui : http://forums.debian.net/viewtopic.php?f=7&t=143865


Chi ti ha risposto nell'altro forum, ti ha fornito nelle indicazioni molto mirate: le hai seguite ?

Hai disabilitato il modulo del kernel nvidia della scheda grafica per la quale intendi attivare il passthrough ?

Hai verificato se la scheda grafica risulta pilotata dal modulo del kernel vfio_pci ?

Hai verificato la topologia dei collegamenti della scheda video sul bus PCI in modo da verificare che, in funzione dello slot PCI in cui la scheda nvidia è fisicamente inserita, l'accesso della CPU alla scheda video sia diretto e non mediato da un hub PCI ?