Setting up nVidia vGPU 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. Installing the dkms package:

    apt-get install dkms
    
  8. We install the driver for the guest OS.

    Disable OS boot with graphical shell:

    sudo init 3
    
  9. Installing the driver:

    dpkg --install driver.deb
    

    Note

    The driver version is selected according to the driver version installed on the Host OS. More information can be found https://docs.nvidia.com/grid/. There you can also find a description of installing the driver in the .run format.

  10. Reboot the OS.

  11. We check that the driver is installed and sees the vGPU profile of the video card:

    nvidia-smi
    
    ../../_images/nvidia_smi.png

    Output example

  12. We configure the receipt of licenses.

    In the file /etc/nvidia/grid.conf specify the values:

    FeatureType=1
    ServerAddress=IP license server
    ServerPort= server port (default 7070)
    

    Restarting services:

    systemctl restart nvidia-gridd.service
    

    Checking that the instance has received a license:

    nvidia-smi -q
    

    The nvidia control panel is invoked with the nvidia-settings command.