Stuck on clean with free drivers using a Virtual Machine

Graphics:
  Device-1: NVIDIA GP107 [GeForce GTX 1050] 
  vendor: PC Partner Limited / Sapphire driver: nvidia v: 470.63.01 
  alternate: nouveau,nvidia_drm bus-ID: 25:00.0 chip-ID: 10de:1c81 
  class-ID: 0300 
  Device-2: NVIDIA GM204 [GeForce GTX 970] vendor: Gigabyte driver: nvidia 
  v: 470.63.01 alternate: nouveau,nvidia_drm bus-ID: 26:00.0 
  chip-ID: 10de:13c2 class-ID: 0300 
  Display: x11 server: X.Org 1.20.13 compositor: xfwm4 v: 4.16.1 driver: 
  loaded: nvidia display-ID: :0.0 screens: 1 
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x286mm (20.0x11.3") 
  s-diag: 583mm (23") 
  Monitor-1: DVI-I-1 res: 1920x1080 hz: 60 dpi: 92 
  size: 531x298mm (20.9x11.7") diag: 609mm (24") 
  OpenGL: renderer: NVIDIA GeForce GTX 970/PCIe/SSE2 v: 4.6.0 NVIDIA 470.63.01 
  direct render: Yes 

you meant that youre walking me through that one right?
thats why you told me to inxi

Now: nvidia driver loaded on both cards in the host OS

Previously, the vfio-pci loaded, ready for pass-through to your VM:

you have to ensure it’s correct on both the host and the VM…

:face_with_monocle:

1 Like

okay ill just pass through then.

probably not gonna just work because the second gpu doesnt work like this but okay ill try.

just to give some progress:

sudo mkinitcpio -p linux512
[sudo] password for jonas: 
==> Building image from preset: /etc/mkinitcpio.d/linux512.preset: 'default'
  -> -k /boot/vmlinuz-5.12-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.12-x86_64.img
==> Starting build: 5.12.19-1-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.12-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux512.preset: 'fallback'
  -> -k /boot/vmlinuz-5.12-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.12-x86_64-fallback.img -S autodetect
==> Starting build: 5.12.19-1-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.12-x86_64-fallback.img
==> Image generation successful
[jonas@jonas-ms7b86 ~]$ uname -r
5.12.19-1-MANJARO

ill be using 5.12 for now. behaviour on 5.10 and 5.12 is the same afaik

just as i said, no gpu worked with this setup.
the passed through gpu did not turn on, as planned, and the other gpu did not turn on as well.

also i could not activate numlock so the pc literally froze

i am back on 5.14 because i would have to remove my gtx970 from the pcie slot now to make 5.12 run and i dont feel like removing it 50 times

Stick to 5.10 LTS (Long Time Support) instead of 5.12 EOL (End Of Life) then…

:scream:

1 Like
sudo mkinitcpio -p linux510
[sudo] password for jonas: 
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: 'default'
  -> -k /boot/vmlinuz-5.10-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.10-x86_64.img
==> Starting build: 5.10.61-1-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: 'fallback'
  -> -k /boot/vmlinuz-5.10-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.10-x86_64-fallback.img -S autodetect
==> Starting build: 5.10.61-1-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64-fallback.img
==> Image generation successful

restarting

5.10 testing done
same outcome as 5.12

lspci -nnk -d 10de:1c81
lspci -nnk -d 10de:13c2
sudo dmesg | grep -i vfio

When? On the Guest or on the Host? If vfio-pci is loaded correctly for a GPU, then it should be able to passthrough to the VM. I would rather think that the configuration on the VM is faulty.

1 Like

on the host no gpu turned on

[jonas@jonas-ms7b86 ~]$ lspci -nnk -d 10de:1c81
25:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP107 [GeForce GTX 1050] [10de:1c81] (rev a1)
	Subsystem: PC Partner Limited / Sapphire Technology Device [174b:5454]
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia_drm, nvidia
[jonas@jonas-ms7b86 ~]$ lspci -nnk -d 10de:13c2
26:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:367a]
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia_drm, nvidia
[jonas@jonas-ms7b86 ~]$ sudo dmesg | grep -i vfio
[sudo] password for jonas: 
[jonas@jonas-ms7b86 ~]$ 

im back on 5.14 because 5.10 is non-operable

As you see both loaded the nvidia driver. One have to be loaded with the vfio-pci driver.

Have look here: https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Binding_vfio-pci_via_device_ID

1 Like

yes. obviously they load the nvidia driver because im on 5.14 and the mkinitcpio was for 5.10!
i cannot use the 5.10 kernel after i did sudo mkinitcpio -p linux510 with the MODULES="vfio_pci vfio vfio_iommu_type1 vfio_virqfd" line

because i get a blackscreen every time

on both gpus

What is on your kernel parameter?

cat /etc/default/grub | grep GRUB_CMDLINE
1 Like
GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=d0dac5d0-5548-41e7-8572-14de99a109cc udev.log_priority=3 iommu=pt"
GRUB_CMDLINE_LINUX=""

add there:

vfio-pci.ids=10de:13c2
sudo update-grub

And it will only choose GTX 970 …

1 Like

in the default parameter?

1 Like

that did nothing on 5.10

parameters look like this now, just to confirm

GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=d0dac5d0-5548-41e7-8572-14de99a109cc udev.log_priority=3 iommu=pt vfio-pci.ids=10de:13c2"
GRUB_CMDLINE_LINUX=""

Yet another inxi, please?