Hello, I am currently using a virtual machine and passing through my NVIDIA graphics card 3070 Ti to a Windows guest or also to a Linux guest, which works wonderfully for me.
My goal now is to be able to dynamically use the NVIDIA graphics card on my host after I have shut down the virtual machine, without having to restart the host to reload the NVIDIA drivers.
As I have often seen, this is resolved with custom alias commands to, for example, activate or deactivate the NVIDIA driver if I want to use the virtual machine again with GPU passthrough.
The ID of my graphics card is: 01:00.0
To activate the NVIDIA on the host, I thought the following would work:
sudo virsh nodedev-reattach pci_0000_01_00_0 \
sudo rmmod vfio_pci vfio_pci_core vfio_iommu_type1 \
sudo modprobe -i nvidia_modeset nvidia_uvm nvidia
However, I get the following output when using modprobe
: modprobe: ERROR: could not insert 'nvidia_modeset': No such device
Also, with sudo modprobe -i nvidia
, I get: modprobe: ERROR: could not insert 'nvidia': No such device
The output of lspci -nnk
shows me that the vfio-pci driver is in use:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104 [GeForce RTX 3070 Ti]
Kernel driver in use: vfio-pci
Kernel modules: nouveau, nvidia_drm, nvidia
01:00.1 Audio device [0403]: NVIDIA Corporation GA104 High Definition Audio Controller
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
I am using EndeavourOS on the host system, and the installed driver is nvidia 560.35.03-1.
I hope someone can help me, thank you in advance and best regards