Install vGPU & Bypass NVIDIA License on Proxmox using FastAPI-DLS and Patched Drivers
This guide explains how to run NVIDIA vGPU on Proxmox using FastAPI-DLS and patched drivers, without relying on the official NVIDIA License Server.
It is intended for users with supported or partially supported GPUs (such as RTX A4000 / A5000 / A6000) who want to unlock vGPU functionality in their virtual machines (Ubuntu or Windows) for AI (Ollama, vLLM), compute, or media workloads.
You need to check if your GPU is supported : https://docs.nvidia.com/vgpu/gpus-supported-by-vgpu.html
If not, you can still use vGPU by following this tutorial and mine to enable vGPU on consumer GPUs : https://gitlab.com/polloloco/vgpu-proxmox
If your card is RTX A4000 / A5000 / A6000 or any other card with display functions and mdev_supported
is missing, this gist is for you.
Here is my configuration : vGPU 18.3 on Proxmox 8.4.1 (NVIDIA-Linux-x86_64-570.158.02-vgpu-kvm.run), VMs like Ubuntu Server 24.04.2 (NVIDIA-Linux-x86_64-570.158.01-grid.run) and Windows 11 (573.39_grid_win10_win11_server2022_dch_64bit_international.exe)
#-- PREPARATION --#
- Confirm that the following features are enabled in your BIOS/UEFI :
- VT-d for Intel, or AMD-v for AMD (sometimes named IOMMU)
- SR-IOV (this may not be necessary for older pre-Ampere GPU generations)
- Above 4G decoding
- Alternative Routing ID Interpretation (ARI) (not necessary for pre-Ampere GPUs)
- On Proxmox -> Node -> Shell, execute the command below, it will set up some basics, like blacklisting the nouveau driver, installing header packages, DKMS, ect. :
pve-nvidia-vgpu-helper setup
- Then reboot.
#-- INSTALLATION --#
#- Host Driver -#
This website is dumping all the drivers from NVIDIA repository so you can download/install without registering : https://alist.homelabproject.cc/foxipan/vGPU
In this exemple, I'll install the NVIDIA-Linux-x86_64-570.158.02-vgpu-kvm.run
Host driver on Proxmox.
- Download the file :
wget https://alist.homelabproject.cc/d/foxipan/vGPU/18.3/NVIDIA-GRID-Linux-KVM-570.158.02-570.158.01-573.39/Host_Drivers/NVIDIA-Linux-x86_64-570.158.02-vgpu-kvm.run
- Make it executable and install (if you don't have all the tools to install, just run
apt install build-essential
before) :
chmod +x NVIDIA-Linux-x86_64-570.158.02-vgpu-kvm.run
./NVIDIA-Linux-x86_64-570.158.02-vgpu-kvm.run
-
Then reboot.
-
Check if vGPU drivers are installed running :
nvidia-smi
andnvidia-smi vgpu
-
Create the mapped device on Proxmox : Datacenter -> Resource Mappings -> Add New PCI Device (enable 'Use with mediated devices') and select all the devices.
-
You can now associate a vGPU profile when creating VM.
!!! INFORMATION !!!
- In my case I'm using a RTX A5000 with display functions so my card need to be flashed to another firmware using
NVIDIA_Display_Mode_Selector_Tool
:
wget https://alist.homelabproject.cc/d/foxipan/vGPU/tools/NVIDIA_Display_Mode_Selector_Tool-March-2022.zip
- Unzip the archive (install unzip if you don't have it :
apt install unzip
) :
unzip NVIDIA_Display_Mode_Selector_Tool-March-2022.zip
- Go to the folder extracted :
cd Mar\ 2022/
- Execute the tool :
./displaymodeselector --gpumode
Now on the Q&A :
Click "y" then select the "<1> physical_display_disabled"
-
Then reboot and install the Host driver again :
./NVIDIA-Linux-x86_64-570.158.02-vgpu-kvm.run
(and reboot again) -
Enable SR-IOV (it as been enabled already with the script but to be sure) :
systemctl enable --now [email protected]
- Now you can check if all mdev are listed :
lspci -d 10de:
You should get something like this :
root@proxmox:~/Mar 2022# lspci -d 10de:
04:00.0 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:00.4 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:00.5 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:00.6 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:00.7 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:01.0 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:01.1 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:01.2 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:01.3 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:01.4 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:01.5 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:01.6 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:01.7 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:02.0 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:02.1 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:02.2 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:02.3 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:02.4 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:02.5 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:02.6 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:02.7 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:03.0 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:03.1 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:03.2 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
04:03.3 3D controller: NVIDIA Corporation GA102GL [RTX A5000] (rev a1)
#-- Guest Driver --#
#- Ubuntu Guest Driver Install -#
- First we need to install FastAPI-DLS, I will install it on a Guest machine (this one), but you can install it on another machine.
export WORKING_DIR=/opt/docker/fastapi-dls/cert
sudo mkdir -p "$WORKING_DIR" && cd "$WORKING_DIR"
sudo openssl genrsa -out instance.private.pem 2048
sudo openssl rsa -in instance.private.pem -pubout -out instance.public.pem
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
-keyout webserver.key -out webserver.crt
- Now create the container :
sudo docker volume create dls-db
sudo docker run -d --name fastapi-dls --restart=always \
-e TZ="Europe/Paris" \ #VERY IMPORTANT : CHANGE THIS TO YOURS
-e DLS_URL="192.168.0.218" \ #IP OF THE FASTAPI_DLS (here this machine)
-e DLS_PORT=443 \
-e LEASE_EXPIRE_DAYS=90 \ #DURATION OF THE LEASE (90 days by default)
-p 443:443 \
-v /opt/docker/fastapi-dls/cert:/app/cert \
-v dls-db:/app/database \
collinwebdesigns/fastapi-dls:latest
- Download the Guest Driver :
sudo wget https://alist.homelabproject.cc/d/foxipan/vGPU/18.3/NVIDIA-GRID-Linux-KVM-570.158.02-570.158.01-573.39/Guest_Drivers/NVIDIA-Linux-x86_64-570.158.01-grid.run
- Make it executable and install it (if you don't have all the tools :
sudo apt install build-essential
) :
sudo chmod +x NVIDIA-Linux-x86_64-570.158.01-grid.run
sudo ./NVIDIA-Linux-x86_64-570.158.01-grid.run
- Download the gridd-unlock-patcher
sudo wget https://git.collinwebdesigns.de/api/v4/projects/129/packages/generic/gridd-unlock-patcher/1.1/gridd-unlock-patcher
- Make it executable :
chmod +x gridd-unlock-patcher
- Get the latest root-certificate from the FastAPI-DLS machine (here : 192.168.0.218) and name it correctly :
sudo wget https://192.168.0.218/-/config/root-certificate --no-check-certificate
sudo mv root-certificate root-certificate.pem
- Start the tool :
sudo gridd-unlock-patcher -g $(which nvidia-gridd) -c root-certificate.pem
- Reboot the nvidia-gridd service and check if all is running :
sudo systemctl restart nvidia-gridd
sudo systemctl status nvidia-gridd
If nvidia-gridd not running go to Troubleshooting 1
#- Windows Guest Driver Install -#
- Download the .exe here :
- Open PowerShell admin privilege and download client_configuration_token.tok from FastAPI-DLS server :
curl.exe -k -L "https://192.168.0.218/-/client-token" -o "C:\Program Files\NVIDIA Corporation\vGPU Licensing\ClientConfigToken\client_configuration_token.tok"
- Restart the nvidia service :
Restart-Service NVDisplay.ContainerLocalSystem
Then open the NVIDIA Control Panel app (check on the minimize apps section down right on your desktop).
You can check if the license is active, if not go to Troubleshooting 2.
#-- TROUBLESHOOTING 1 --#
The token is signed with a precise date/time. If there is a clock discrepancy between your Windows and the Ubuntu server, the token is silently rejected.
- On Windows : Open PowerShell admin privilege :
Get-Date
- On Ubuntu :
date
-
If not synced :
-
On Ubuntu (set to your TZ) :
sudo timedatectl set-timezone Europe/Paris
sudo timedatectl set-ntp true
- Restart fastapi-dls container :
sudo docker restart fastapi-dls
- On Windows :
Remove-Item "C:\Program Files\NVIDIA Corporation\vGPU Licensing\ClientConfigToken\client_configuration_token.tok"
curl.exe -k -L "https://192.168.0.218/-/client-token" -o "C:\Program Files\NVIDIA Corporation\vGPU Licensing\ClientConfigToken\client_configuration_token.tok"
Restart-Service NVDisplay.ContainerLocalSystem
If still not licensed, then continue.
We will generate the certs with Common Name and Subject Alternative Name :
- On Ubuntu
sudo mkdir -p /opt/docker/fastapi-dls/cert
cd /opt/docker/fastapi-dls/cert
sudo rm -f webserver.*
sudo nano /opt/docker/fastapi-dls/cert/openssl-san.cnf
Content :
[req]
default_bits = 2048
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = FR
ST = France
L = Paris
O = Home
OU = IT
CN = 192.168.0.218 #IP OF FASTAPI-DLS HOST
[v3_req]
subjectAltName = @alt_names
[alt_names]
IP.1 = 192.168.0.218 #IP OF FASTAPI-DLS HOST
cd /opt/docker/fastapi-dls/cert
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
-keyout webserver.key -out webserver.crt \
-config openssl-san.cnf
sudo docker restart fastapi-dls
- On Windows :
Download :
- https://alist.homelabproject.cc/d/foxipan/vGPU/18.3/Guest_Drivers_Patched/nvxdapix.dll -> Put it on the Desktop.
- https://git.collinwebdesigns.de/vgpu/gridd-unlock-patcher/-/blob/main/windows-replace-nvxdapix.ps1 -> Put it on the Desktop.
- Start CMD admin privilege :
powershell.exe -executionpolicy bypass -file "$HOME\Desktop\windows-replace-nvxdapix.ps1"
- Restart :
Restart-Service NVDisplay.ContainerLocalSystem
#-- TROUBLESHOOTING 2 --#
- Install the nvidia-gridd patched :
sudo wget https://alist.homelabproject.cc/d/foxipan/vGPU/18.3/Guest_Drivers_Patched/nvidia-gridd
- Make it executable :
sudo chmod +x nvidia-gridd
- Rename the origin nvidia-gridd :
sudo mv /usr/bin/nvidia-gridd /usr/bin/nvidia-gridd.bak
- Copy the patch :
sudo cp /temporary/nvidia-gridd /usr/bin/nvidia-gridd
- Restart and check :
sudo systemctl restart nvidia-gridd
sudo systemctl status nvidia-gridd
Sources :
https://pve.proxmox.com/wiki/NVIDIA_vGPU_on_Proxmox_VE#Software_Versions https://forums.developer.nvidia.com/t/issue-in-vgpu-setup-in-ubuntu-20-04-3/198570/13 https://alist.homelabproject.cc/foxipan/vGPU https://git.collinwebdesigns.de/oscar.krause/fastapi-dls https://git.collinwebdesigns.de/vgpu/gridd-unlock-patcher