This article was translated by the Chinese version using Google Translate

Chinese : nvidia-intel-nvidia-直通独显 | Juana’s Blog

This article was translated by the Chinese version using Google Translate

1. Please make sure your bios supports pci passthrough (VT-D virtualization)

2. Linux cannot use CUDA after passthrough

Environment preparation

1.windows iso file windows distribution in China, viro driver iso

2. A computer equipped with ubuntu uses grub as boot

start installation

1. Install KVM

1
2
sudo apt-get update
sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst virt-manager ovmf

image.png

2. Setup libvirt

1
2
sudo systemctl start libvirtd
sudo systemctl enable libvirtd

3. Give users permission to manage kvm

1
2
sudo usermod -aG libvirt $USER
sudo usermod -aG kvm $USER

4. Open iommu

Check if iommu is enabled

1
2
cat /proc/cmdline | grep iommu

image.png If the output is like the picture above, please go to the next step

1
2

sudo nano /etc/default/grub

Add intel_iommu=on inside =”” of GRUB_CMDLINE_LINUX_DEFAULT

image.png

After adding, press ctrl + x to save and exit

1
sudo update-grub

Then restart the computer with sudo reboot

5. Unbind the graphics card from the host

Change nvidia driver to open source driver

image.png

Change root password: sudo passwd root

su

1
2
echo 'blacklist nouveau
blacklist snd_hda_intel' >> /etc/modprobe.d/blacklist.conf

image.png

Reboot system sudo reboot

Install the system and configure the independent display passthrough

Open virt-manager to create a new virtual machine

image.png

In the second step, choose the iso of windows

image.png

Tick Customize configuration before installation Click Finish

image.png

If it is windows10, select according to the above picture

For win11, select x86_64 with secboot

image.png

Change hard drive from sata to virtio

Add viro driver iso

image.png

pci passthrough independent display

image.png

Be sure to modify the boot option

After modifying the configuration, click Start Installation

Press any button (do not press the power button) to enter the Windows installation when booting

image.png

Select Custom

Click Load Driver OK to select the applicable driver for your Windows version

image.png

Install guest-tools as administrator

Be sure to go to nvidia official website to install the latest driver

image.png

Straight through to success, enjoy it!