Nvidia vGPU Driver Instructions

  • Blog
  • 2023.05.23
  • 96 views

Why you need GRID Drivers

GRID drivers are required to use the on your server. Without them, you will not be able to use the GPU. Using generic consumer drivers from or from the repo is not an option! These drivers simply do not allow products to function or be used. NVIDIA only supports GRID drivers for vGPU and the drivers must be within the same driver branch as the hosts the instance is run on.

CUDA

CUDA is not one, but two separate pieces of software. The CUDA driver, and the CUDA toolkit.
nvidia

The CUDA Driver

DO NOT install a CUDA driver! The CUDA driver is built into the NVIDIA driver. Installing another driver will replace your installed NVIDIA driver AND CUDA driver and break your system. You cannot change the version of the CUDA driver. However the CUDA driver is reverse compatible up to CUDA 11, and forward compatible completely.

The CUDA Toolkit

The CUDA Toolkit is the thing you will be needing to install, not the driver. The toolkit may be any compatible version with the driver. The package is normally nvidia-cuda-toolkit on most distros.

Required Steps

Install Prerequisites

RHEL (CentOS, Fedora, etc.)

yum install -y epel-release
yum group install "Development Tools" -y
yum install -y wget cmake pkg-config libglvnd-devel mesa-libGL-devel zlib kernel-headers kernel-devel

Debian

apt-get update && apt-get install -y vim man wget unzip curl gnupg2 ca-certificates lsb-release apache2-utils \
    ethtool wget build-essential zlib1g cmake pkg-config libglvnd-dev libegl1 libopenblas-dev liblapack-dev \
    linux-headers-amd64

Ubuntu

apt-get update && apt-get install -y vim man wget unzip curl gnupg2 ca-certificates lsb-release apache2-utils \
    ethtool wget build-essential zlib1g cmake pkg-config libglvnd-dev libegl1 libopenblas-dev liblapack-dev \
    linux-headers-generic

Blacklist Nouveau and modprobe NVIDIA

BLACKLIST_FILE=$(cat < /etc/modules-load.d/nvidia.conf
echo "${BLACKLIST_FILE}" > /etc/modprobe.d/blacklist-nouveau.conf

Install Licensing

NVIDIA_GRIDD_CONFIG='U2VydmVyQWRkcmVzcz1udmlkaWFsaWMudnVsdHJsYWJzLmNvbQpGZWF0dXJlVHlwZT0xCkVuYWJsZVVJPUZBTFNFCkxpY2Vuc2VIb3N0SWQ9e3tNQUNIRVJFfX0K'
NVIDIA_T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3lOczEtdVpIVzNKT190emtOX19rSmxtZDgtbHJKX3pNRmJwQXBZMFBsTThmWlFYNFlHNWJHMlZkbDNkSTF3WFNIX0hLV2VDa1JtTnVZRVZKY2UwNHR2OEZCWnFscDB1WjdUSE9JLW82NF96RTlpNDJBdFJlU0d1dzUwb2U2UV9FRl8zaVdqVlRiNEZ0MGVIOHJGVmhpSTZzeFRoN3hadGVNdmtzWllBcHVZbUJ1TGNkd0xFWWFTbUNKX0xSZlk5YW95ZldVbktKSWwxSm8wUmtiNWZyeGp5cG5OeWt1T2ZFdXlyUEdvSHQtWHZ0NlhyX3dpVVNOd3dZdUJDUnZuNjlWV3YxUjdhb2FoenAteWt4Smx5aW9YcV91X0Q0c1lLWFJia2d3Y19ESGlkbWJTVDVqcThjSXZQWS13NFE='
mkdir -p /etc/nvidia/ClientConfigToken
echo "${NVIDIA_GRIDD_CONFIG}" | base64 -d | sed 's|{{MACHERE}}|43108389|' > /etc/nvidia/gridd.conf
echo "${NVIDIA_TOKEN}" | base64 -d > /etc/nvidia/ClientConfigToken/nvidialic.vultrlabs.com

Repo Install (Deb, RHEL)

Install App Repo

RHEL (CentOS, Fedora, etc.)

APPREPO_KEY=$(cat < /etc/yum.repos.d/vultr-apprepo.repo
echo "${APPREPO_KEY}" > /etc/pki/rpm-gpg/RPM-GPG-KEY-apprepo
update-crypto-policies --set DEFAULT:SHA1 || true

Deb (Debian, Ubuntu, Mint, etc)

APPREPO_KEY=$(cat < /etc/apt/sources.list.d/vultr-apprepo.list
echo "${APPREPO_KEY}" | gpg --dearmor > /usr/share/keyrings/vultr-apprepo.gpg
apt update -y

Install the driver

RHEL (CentOS, Fedora, etc.)

yum install -y vultr-nvidia-client-drivers

Deb (Ubuntu, Debian, Mint, etc.)

apt install -y vultr-nvidia-client-drivers

Manual Install (Arch, Alpine)

Manually Install NVIDIA Drivers

mkdir -p /opt/nvidia/drivers/
wget http://169.254.169.254/latest/nvidia_linux_driver_url -O /opt/nvidia/drivers/nvidia_manual_driver.run
chmod +x /opt/nvidia/drivers/nvidia_manual_driver.run
/opt/nvidia/drivers/nvidia_manual_driver.run --ui=none --no-questions