Looking glass/GPU passthrough/baby's first VM

wrap it with backticks for code blocks. “`”

I’m not actually sure how to get to that grub file, did the command you gave me already edit it or did it just disable read only mode?
sudo grub-mkconfig -o /boot/grub/grub.cfg

So the command I gave you regenerated the grub configuration.

That’s done after you edit it.

so you can just sudo nano /etc/default/grub to edit it.

1 Like

so I can just add in anywhere
amd_iommu=on
I cannot even triforce

Oh, sorry, I should have been more clear.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

You should see something like snippit above.

Dump it in there, would look like:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=on iommu=1"

Sorry, the code snippits look like this:

Screenshot from 2020-05-24 15-09-49

@Eden needs to update his guide :stuck_out_tongue:

1 Like

To learn about the forum’s features, please refer to this thread:

New canned reply ^^

okay I typed it in, now how do I save changes

with nano, it’s ctrl+o and then just hit return.

okay now how do I get back to terminal

ctrl+x

the menu at the bottom, shows your commands. the ^ symbol means ctrl.

okay now I redid the command
sudo grub-mkconfig -o /boot/grub/grub.cfg

you then said make a script and save it
do I just paste it in the terminal?

I was just talking about the IOMMU groups script that you ran above.


Now that you’ve got iommu config up, and you’ve got your IOMMU groups, you need to blacklist nvidia and set up vfio.

blacklist nvidia
blacklist nouveau

needs to go into /etc/modprobe.d/blacklist.conf

Then you need your device ids, lspci -knn, and you will see something like this:

43:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1070 Ti] [10de:1b82] (rev a1)
	Subsystem: Micro-Star International Co., Ltd. [MSI] GP104 [GeForce GTX 1070 Ti] [1462:c303]
	Kernel driver in use: nvidia
	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

you want the part after the GPU name, [10de:1b82] on mine.

okay so how do I detremine if I need the ACS Patch
the K40 is in group 7 and the Vega 11 is in group 9 and both by themselves in each group as far as I can tell

IOMMU Group 10 0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de]
IOMMU Group 10 0a:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
IOMMU Group 10 0a:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e0]
IOMMU Group 10 0a:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e1]
IOMMU Group 10 0a:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3]
IOMMU Group 1 00:01.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 2 00:01.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 3 00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 4 00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A [1022:15db]
IOMMU Group 5 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
IOMMU Group 5 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU Group 6 00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 0 [1022:15e8]
IOMMU Group 6 00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 1 [1022:15e9]
IOMMU Group 6 00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 2 [1022:15ea]
IOMMU Group 6 00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 3 [1022:15eb]
IOMMU Group 6 00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 4 [1022:15ec]
IOMMU Group 6 00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 5 [1022:15ed]
IOMMU Group 6 00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 6 [1022:15ee]
IOMMU Group 6 00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 7 [1022:15ef]
IOMMU Group 7 01:00.0 3D controller [0302]: NVIDIA Corporation GK110BGL [Tesla K40m] [10de:1023] (rev a1)
IOMMU Group 8 02:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset USB 3.1 xHCI Controller [1022:43bb] (rev 02)
IOMMU Group 8 02:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset SATA Controller [1022:43b7] (rev 02)
IOMMU Group 8 02:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Device [1022:43b2] (rev 02)
IOMMU Group 8 03:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:01.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:05.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:06.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 03:07.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)
IOMMU Group 8 07:00.0 Network controller [0280]: Intel Corporation Wireless 3165 [8086:3165] (rev 81)
IOMMU Group 8 09:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
IOMMU Group 9 0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd] (rev c6)

If the Tesla is in a group with anything else, you need the ACS patch.

It’s alone in group 7. Should be all set.

1 Like

Once you’ve got your PCI device ids, you need to throw them in a file, /etc/modprobe.d/vfio.conf, like this:

options vfio-pci ids=10de:1b06

Except replace the id with the one you got from the lspci command.

when I opened that in nano it was blank? is that right or no

Yep, both of the files are new files, so should be blank.

okay, file made

Sweet, now that this is done, you should be able to simply reboot and it’ll take effect.

you can check by lspci -knn when you reboot, and it should say Kernel driver in use: vfio-pci

hmmm maybe I didn’t do something right

	Subsystem: NVIDIA Corporation 12GB Computational Accelerator [10de:097e]
	Kernel driver in use: nvidia
	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia