Setting up nVidia passthrough for instance on Astra Linux 1.7

  1. Configuring the vGPU operating mode on the host OS.
  2. We start the instance with vGPU forwarding on the corresponding host.

Further, all actions are performed on instance.

  1. Add kernel options to enable iommu support and disable nouveau driver loading.

    Add to /etc/default/grub:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1 iommu=pt modprobe.blacklist=nouveau"
    

    Update grub:

    update-grub2
    
  2. Add to blacklist the nouveau driver:

    blacklist nouveau
    options nouveau modeset=0
    
  3. Create a configuration file /etc/modprobe.d/blacklist-nouveau.conf.

    Add to file:

    blacklist nouveau
    blacklist nvidiafb
    options nouveau modeset=0
    
  4. Add to the file /etc/modules loading kernel modules:

    pci_stub
    vfio
    vfio_iommu_type1
    vfio-pci
    vfio_pci
    kvm
    kvm_intel
    
  5. Collecting:

    sudo update-initramfs -u
    
  6. Reboot the system.

  7. We are installing the driver for the guest OS. For this it is necessary:

    Disable OS boot with GUI:

    sudo init 3
    

    Install driver:

    sudo sh ./driver.run
    
  8. Check if the video card is detected:

    nvidia-smi
    
  9. Reboot the OS.

The nvidia control panel is called by the nvidia-settings command.