VK Cloud logo

Installing the Linux vGPU driver and configuring the licensing token

After completing this instruction, the vGPU driver will be installed and the licensing token will be configured.

The vGPU driver does not support updates. To change its version, first remove it, and then install it again by repeating the steps in this instruction.

Preparation steps

  1. Check your VM's configuration type:

    1. Go to your VK Cloud personal account.
    2. Go to Cloud ComputingVirtual Machines.
    3. In the list, find the VM for which you need to install the vGPU driver. Make sure the Type column shows a vGPU configuration flavor.
  2. Connect the VM to an external network if you haven't done so already.

  3. Connect to the VM with vGPU.

1. Install the vGPU driver

  1. Check whether the vGPU driver is installed:

    nvidia-smi --query-gpu=driver_version,virtualization.mode,virtualization.virtualized,name --format=csv,noheader

    The following results are possible:

    • A No such file or directory error means the driver is not installed.
    • The command output shows a driver version, and the virtualization type is shown as vGPU. This means the driver is already installed and the NVIDIA stack was initialized successfully. No further action is required.
    • nvidia-smi runs, but the output shows a ... couldn't communicate with the NVIDIA driver error. This means the driver is damaged or an incorrect version is used (for example, for dedicated GPUs). You need to reinstall the driver: first remove it, then install it again by repeating the steps in this instruction.
  2. Prepare the OS:

    1. (Optional) Update the system components and reboot the VM to avoid compatibility issues.

      Run the commands:

      sudo apt update &&sudo apt upgrade -y &&sudo reboot
    2. Install the additional packages required to install the driver:

      sudo apt install -y build-essential dkms perl pkg-config libelf-dev linux-headers-$(uname -r)
  3. Download the NVIDIA® GRID driver using one of the following methods:

    wget https://hub.mcs.mail.ru/repository/gpu-drivers-raw/bin/nvidia/guest-drivers/latest/vgpu_driver_linux.run
  4. Grant execute permission to the downloaded file:

    chmod +x vgpu_driver_linux.run
  5. Run the file and follow the installer's instructions:

    sudo ./vgpu_driver_linux.run
  6. Reboot the VM.

2. Configure the licensing token

  1. Download the licensing script using one of the following methods:

    wget https://hub.mcs.mail.ru/repository/gpu-drivers-raw/bin/nvidia/nvidia-token-fetcher/latest/nvidia_token_fetcher
  2. Grant execute permission to the script:

    chmod +x nvidia_token_fetcher
  3. Run the script:

    sudo ./nvidia_token_fetcher
  4. Check the licensing configuration:

    1. Make sure the licensing token file exists:

      sudo ls /etc/nvidia/ClientConfigToken/
    2. Check the license status:

      nvidia-smi -q | grep -i license

      Output for a correctly configured license:

      vGPU Software Licensed Product    License Status: Licensed
  5. (Optional) Configure automatic licensing token verification at system startup.

    If the VM was created from a prepared OpenStack image, automation can be configured using cloud-init. You can also use systemd.

    Copy the script file to a dedicated directory:

    sudo cp nvidia_token_fetcher /var/lib/cloud/scripts/per-boot/
Was this article helpful?