12 Commits

Author SHA1 Message Date
Kenny.ch
fdaa594afc Merge branch 'master' into 'master'
Fixed Guide for Security, Stability, and Sanity

See merge request polloloco/vgpu-proxmox!6
2024-02-24 16:30:16 +00:00
Kenny.ch
c32b4c329f Update file README.md 2024-02-24 16:30:05 +00:00
Kenny.ch
8e85d32eb0 Fixed Guide for security / stability and sanity 2024-02-15 17:22:10 +00:00
PolloLoco
3110f37d80 14.x and 15.x driver versions are EOL. Add note about possible issue with display dummy plugs 2023-12-21 12:03:25 +01:00
PolloLoco
0c1d8e6bea Update guide with 16.2 (535.129.03) patch 2023-11-08 13:08:06 +01:00
PolloLoco
028d78af09 Update guide with 16.1 (535.104.06) patch 2023-09-23 11:28:34 +02:00
PolloLoco
9e3df0bdff Update guide to Proxmox VE 8.0 and vGPU 16.0 drivers 2023-07-10 20:52:37 +02:00
PolloLoco
e2955b232a Remove spoofing instructions. Please don't use spoofing anymore :) 2023-05-29 18:46:57 +02:00
PolloLoco
a577cc6625 Convert CRLF to LF 2023-03-29 20:13:10 +02:00
PolloLoco
df93332349 Update to pve 7.4 2023-03-29 20:12:16 +02:00
PolloLoco
ba197fb9ac Add buymeacoffee link 2023-01-24 21:05:02 +01:00
PolloLoco
646e599bce Add support for different driver versions 2023-01-24 20:40:41 +01:00
7 changed files with 641 additions and 625 deletions

BIN
510.108.03.patch Normal file

Binary file not shown.

BIN
510.85.03.patch Normal file

Binary file not shown.

BIN
525.85.07.patch Normal file

Binary file not shown.

BIN
535.104.06.patch Normal file

Binary file not shown.

BIN
535.129.03.patch Normal file

Binary file not shown.

BIN
535.54.06.patch Normal file

Binary file not shown.

176
README.md
View File

@@ -1,22 +1,34 @@
# NVIDIA vGPU with the GRID 15.0 driver on Proxmox # NVIDIA vGPU on Proxmox
In december 2022, NVIDIA released their latest enterprise GRID driver. I created a patch that allows the use of most consumer GPUs for vGPU. One notable exception from that list is every officially unsupported Ampere GPU and GPUs from the Ada Lovelace generation. [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/polloloco)
> ## !!! YOUR RTX 30XX OR 40XX WILL NOT WORK AT THIS POINT IN TIME !!! This document serves as a guide to install NVIDIA vGPU host drivers on the latest Proxmox VE version, at time of writing this its pve 8.1.
You can follow this guide if you have a vGPU supported card from [this list](https://docs.nvidia.com/grid/gpus-supported-by-vgpu.html), or if you are using a consumer GPU from the GeForce series or a non-vGPU qualified Quadro GPU. There are several sections with a title similar to "Have a vGPU supported GPU? Read here" in this document, make sure to read those very carefully as this is where the instructions differ for a vGPU qualified card and a consumer card.
## Supported cards
The following consumer/not-vGPU-qualified NVIDIA GPUs can be used with vGPU:
- Most GPUs from the Maxwell 2.0 generation (GTX 9xx, Quadro Mxxxx, Tesla Mxx) **EXCEPT the GTX 970**
- All GPUs from the Pascal generation (GTX 10xx, Quadro Pxxxx, Tesla Pxx)
- All GPUs from the Turing generation (GTX 16xx, RTX 20xx, Txxxx)
If you have GPUs from the Ampere and Ada Lovelace generation, you are out of luck, unless you have a vGPU qualified card from [this list](https://docs.nvidia.com/grid/gpus-supported-by-vgpu.html) like the A5000 or RTX 6000 Ada. If you have one of those cards, please consult the [NVIDIA documentation](https://docs.nvidia.com/grid/15.0/grid-vgpu-user-guide/index.html) for help with setting it up.
> **!!! THIS MEANS THAT YOUR RTX 30XX or 40XX WILL NOT WORK !!!**
This guide and all my tests were done on a RTX 2080 Ti which is based on the Turing architechture. This guide and all my tests were done on a RTX 2080 Ti which is based on the Turing architechture.
### This tutorial assumes you are using a clean install of Proxmox 7.3, or ymmv when using an existing installation. Make sure to always have backups! ## Important notes before starting
- This tutorial assumes you are using a clean install of Proxmox VE 8.1.
- If you are using Proxmox VE 8.1, you **MUST** use 16.x drivers. Older versions only work with pve 7
- If you tried GPU-passthrough before, you absolutely **MUST** revert all of the steps you did to set that up.
- If you only have one GPU in your system with no iGPU, your local monitor will **NOT** give you any output anymore after the system boots up. Use SSH or a serial connection if you want terminal access to your machine.
- Most of the steps can be applied to other linux distributions, however I'm only covering Proxmox VE here.
This guide should work for other linux systems with a recent kernel (5.15 to 5.19) but I have only tested it on the current proxmox version. > ## Are you upgrading from a previous version of this guide?
If you are not using proxmox, you have to adapt some parts of this tutorial to work for your distribution.
> # Are you upgrading from a previous version of this guide?
> >
> If you are upgrading from a previous version of this guide, you should uninstall the old driver first: > If you are upgrading from a previous version of this guide, you should uninstall the old driver by running `nvidia-uninstall` first.
> ```
> nvidia-uninstall
> ```
> >
> Then you also have to make sure that you are using the latest version of `vgpu_unlock-rs`, otherwise it won't work with the latest driver. > Then you also have to make sure that you are using the latest version of `vgpu_unlock-rs`, otherwise it won't work with the latest driver.
> >
@@ -27,7 +39,7 @@ If you are not using proxmox, you have to adapt some parts of this tutorial to w
Make sure to add the community pve repo and get rid of the enterprise repo (you can skip this step if you have a valid enterprise subscription) Make sure to add the community pve repo and get rid of the enterprise repo (you can skip this step if you have a valid enterprise subscription)
```bash ```bash
echo "deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription" >> /etc/apt/sources.list echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" >> /etc/apt/sources.list
rm /etc/apt/sources.list.d/pve-enterprise.list rm /etc/apt/sources.list.d/pve-enterprise.list
``` ```
@@ -123,17 +135,20 @@ Depending on which system you are using to boot, you have to chose from the foll
If you are using an Intel system, append this after `quiet`: If you are using an Intel system, append this after `quiet`:
``` ```
intel_iommu=on iommu=pt intel_iommu=on
``` ```
On AMD systems, append this after `quiet`: On AMD systems, you don't have to add anything and amd_iommu=on does not exist:
https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html?highlight=amd_iommu
For either AMD or Intel there is an option incase you have heavy performance issues, but with the loss of security and stability of the system:
``` ```
amd_iommu=on iommu=pt iommu=pt
``` ```
The result should look like this (for intel systems): The result should look like this (for intel systems):
``` ```
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt" GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
``` ```
Now, save and exit from the editor using Ctrl+O and then Ctrl+X and then apply your changes: Now, save and exit from the editor using Ctrl+O and then Ctrl+X and then apply your changes:
@@ -157,17 +172,20 @@ Depending on which system you are using to boot, you have to chose from the foll
On Intel systems, append this at the end On Intel systems, append this at the end
``` ```
intel_iommu=on iommu=pt intel_iommu=on
``` ```
For AMD, use this On AMD systems, you don't have to add anything and amd_iommu=on does not exist:
https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html?highlight=amd_iommu
For either AMD or Intel there is an option incase you have heavy performance issues, but with the loss of security and stability of the system:
``` ```
amd_iommu=on iommu=pt iommu=pt
``` ```
After editing the file, it should look similar to this After editing the file, it should look similar to this
``` ```
root=ZFS=rpool/ROOT/pve-1 boot=zfs intel_iommu=on iommu=pt root=ZFS=rpool/ROOT/pve-1 boot=zfs intel_iommu=on
``` ```
Now, save and exit from the editor using Ctrl+O and then Ctrl+X and then apply your changes: Now, save and exit from the editor using Ctrl+O and then Ctrl+X and then apply your changes:
@@ -241,7 +259,23 @@ Depending on your mainboard and cpu, the output will be different, in my output
## NVIDIA Driver ## NVIDIA Driver
As of the time of this writing (December 2022), the latest available GRID driver is 15.0 with vGPU driver version 525.60.12. You can check for the latest version [here](https://docs.nvidia.com/grid/). I cannot guarantee that newer versions would work without additional patches, the patch in this guide works **ONLY** on 15.0 (525.60.12). This repo contains patches that allow you to use vGPU on not-qualified-vGPU cards (consumer GPUs). Those patches are binary patches, which means that each patch works **ONLY** for a specific driver version.
I've created patches for the following driver versions:
- 16.2 (535.129.03) - Use this if you are on pve 8.1 (kernel 6.2, 6.5 should work too)
- 16.1 (535.104.06)
- 16.0 (535.54.06)
> ### The following versions are EOL, don't use them unless you have a very specific reason!
> - 15.1 (525.85.07)
> - 15.0 (525.60.12)
> - 14.4 (510.108.03)
> - 14.3 (510.108.03)
> - 14.2 (510.85.03)
You can choose which of those you want to use, but generally its recommended to use the latest, most up-to-date version (16.2 in this case).
If you have a vGPU qualified GPU, you can use other versions too, because you don't need to patch the driver. However, you still have to make sure they are compatible with your proxmox version and kernel. Also I would not recommend using any older versions unless you have a very specific requirement.
### Obtaining the driver ### Obtaining the driver
@@ -249,29 +283,28 @@ NVIDIA doesn't let you freely download vGPU drivers like they do with GeForce or
NB: When applying for an eval license, do NOT use your personal email or other email at a free email provider like gmail.com. You will probably have to go through manual review if you use such emails. I have very good experience using a custom domain for my email address, that way the automatic verification usually lets me in after about five minutes. NB: When applying for an eval license, do NOT use your personal email or other email at a free email provider like gmail.com. You will probably have to go through manual review if you use such emails. I have very good experience using a custom domain for my email address, that way the automatic verification usually lets me in after about five minutes.
The file you are looking for is called `NVIDIA-GRID-Linux-KVM-525.60.12-525.60.13-527.41.zip`, you can get it from the download portal by downloading version 15.0 for `Linux KVM`. I've created a small video tutorial to find the right driver version on the NVIDIA Enterprise Portal. In the video I'm downloading the 15.0 driver, if you want a different one just replace 15.0 with the version you want:
![Video Tutorial to find the right driver](downloading_driver.mp4) ![Video Tutorial to find the right driver](downloading_driver.mp4)
For those who want to find the file somewhere else, here are some checksums :) After downloading, extract the zip file and then copy the file called `NVIDIA-Linux-x86_64-DRIVERVERSION-vgpu-kvm.run` (where DRIVERVERSION is a string like `535.129.03`) from the `Host_Drivers` folder to your Proxmox host into the `/root/` folder using tools like FileZilla, WinSCP, scp or rsync.
```
sha1: e4147e1dcebfc5459759ea013b56bca1d30f3578
md5: 0e2be7de643b99a62a1cca6ca37fd1ee
```
After downloading, extract that and copy the file `NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm.run` to your Proxmox host into the `/root/` folder ### ⚠️ From here on, I will be using the 16.2 driver, but the steps are the same for other driver versions
```bash
scp NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm.run root@pve:/root/ For example when I run a command like `chmod +x NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm.run`, you should replace `535.129.03` with the driver version you are using (if you are using a different one). You can get the list of version numbers [here](#nvidia-driver).
```
Every step where you potentially have to replace the version name will have this warning emoji next to it: ⚠️
> ### Have a vgpu supported card? Read here! > ### Have a vgpu supported card? Read here!
> >
> If you don't have a card like the Tesla P4, or any other gpu from [this list](https://docs.nvidia.com/grid/gpus-supported-by-vgpu.html), please continue reading at [Patching the driver](#patching-the-driver) > If you don't have a card like the Tesla P4, or any other gpu from [this list](https://docs.nvidia.com/grid/gpus-supported-by-vgpu.html), please continue reading at [Patching the driver](#patching-the-driver)
> >
> With a supported gpu, patching the driver is not needed, so you should skip the next section. You can simply install the driver package like this: > With a supported gpu, patching the driver is not needed, so you should skip the next section. You can simply install the driver package like this:
>
> ⚠️
> ```bash > ```bash
> chmod +x NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm.run > chmod +x NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm.run
> ./NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm.run --dkms > ./NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm.run --dkms
> ``` > ```
> >
> To finish the installation, reboot the system > To finish the installation, reboot the system
@@ -284,26 +317,32 @@ scp NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm.run root@pve:/root/
### Patching the driver ### Patching the driver
Now, on the proxmox host, make the driver executable Now, on the proxmox host, make the driver executable
⚠️
```bash ```bash
chmod +x NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm.run chmod +x NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm.run
``` ```
And then patch it And then patch it
⚠️
```bash ```bash
./NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm.run --apply-patch ~/vgpu-proxmox/525.60.12.patch ./NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm.run --apply-patch ~/vgpu-proxmox/535.129.03.patch
``` ```
That should output a lot of lines ending with That should output a lot of lines ending with
``` ```
Self-extractible archive "NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm-custom.run" successfully created. Self-extractible archive "NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm-custom.run" successfully created.
``` ```
You should now have a file called `NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm-custom.run`, that is your patched driver. You should now have a file called `NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm-custom.run`, that is your patched driver.
### Installing the driver ### Installing the driver
Now that the required patch is applied, you can install the driver Now that the required patch is applied, you can install the driver
⚠️
```bash ```bash
./NVIDIA-Linux-x86_64-525.60.12-vgpu-kvm-custom.run --dkms ./NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm-custom.run --dkms
``` ```
The installer will ask you `Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later.`, answer with `Yes`. The installer will ask you `Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later.`, answer with `Yes`.
@@ -312,7 +351,7 @@ Depending on your hardware, the installation could take a minute or two.
If everything went right, you will be presented with this message. If everything went right, you will be presented with this message.
``` ```
Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 525.60.12) is now complete. Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 535.129.03) is now complete.
``` ```
Click `Ok` to exit the installer. Click `Ok` to exit the installer.
@@ -331,9 +370,9 @@ nvidia-smi
You should get an output similar to this one You should get an output similar to this one
``` ```
Sun Dec 4 12:54:59 2022 Tue Jan 24 20:21:28 2023
+-----------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.60.12 Driver Version: 525.60.12 CUDA Version: N/A | | NVIDIA-SMI 525.85.07 Driver Version: 525.85.07 CUDA Version: N/A |
|-------------------------------+----------------------+----------------------+ |-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
@@ -388,9 +427,9 @@ nvidia-smi vgpu
If everything worked right with the unlock, the output should be similar to this: If everything worked right with the unlock, the output should be similar to this:
``` ```
Sun Dec 4 12:55:09 2022 Tue Jan 24 20:21:43 2023
+-----------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.60.12 Driver Version: 525.60.12 | | NVIDIA-SMI 525.85.07 Driver Version: 525.85.07 |
|---------------------------------+------------------------------+------------+ |---------------------------------+------------------------------+------------+
| GPU Name | Bus-Id | GPU-Util | | GPU Name | Bus-Id | GPU-Util |
| vGPU ID Name | VM ID VM Name | vGPU-Util | | vGPU ID Name | VM ID VM Name | vGPU-Util |
@@ -404,6 +443,8 @@ However, if you get this output, then something went wrong
No supported devices in vGPU mode No supported devices in vGPU mode
``` ```
If any of those commands give the wrong output, you cannot continue. Please make sure to read everything here very carefully and when in doubt, create an issue or join the [discord server](#support) and ask for help there.
## vGPU overrides ## vGPU overrides
Further up we have created the file `/etc/vgpu_unlock/profile_override.toml` and I didn't explain what it was for yet. Using that file you can override lots of parameters for your vGPU instances: For example you can change the maximum resolution, enable/disable the frame rate limiter, enable/disable support for CUDA or change the vram size of your virtual gpus. Further up we have created the file `/etc/vgpu_unlock/profile_override.toml` and I didn't explain what it was for yet. Using that file you can override lots of parameters for your vGPU instances: For example you can change the maximum resolution, enable/disable the frame rate limiter, enable/disable support for CUDA or change the vram size of your virtual gpus.
@@ -538,42 +579,6 @@ Here are some common framebuffer sizes that you might want to use:
`framebuffer` and `framebuffer_reservation` will always equal the VRAM size in bytes when added together. `framebuffer` and `framebuffer_reservation` will always equal the VRAM size in bytes when added together.
### Spoofing your vGPU instance
#### Note: This only works on Windows guests, don't bother trying on Linux.
You can very easily spoof your virtual GPU to a different card, so that you could install normal quadro drivers instead of the GRID drivers that require licensing.
For that you just have to add two lines to the override config. In this example I'm spoofing my Turing based card to a normal RTX 6000 Quadro card:
```toml
[profile.nvidia-259]
# insert all of your other overrides here too
pci_device_id = 0x1E30
pci_id = 0x1E3012BA
```
`pci_device_id` is the pci id from the card you want to spoof to. In my case its `0x1E30` which is the `Quadro RTX 6000/8000`.
`pci_id` can be split in two parts: `0x1E30 12BA`, the first part `0x1E30` has to be the same as `pci_device_id`. The second part is the subdevice id. In my case `12BA` means its a RTX 6000 card and not RTX 8000.
You can get the IDs from [here](https://pci-ids.ucw.cz/read/PC/10de/). Just Ctrl+F and search the card you want to spoof to, then copy the id it shows you on the left and use it for `pci_device_id`.
After doing that, click the same id, it should open a new page where it lists the subsystems. If there are none listed, you must use `0000` as the second value for `pci_id`. But if there are some, you have to select the one you want and use its id as the second value for `pci_id` (see above).
## Important note when spoofing
You have to pick a Quadro Driver from the same driver branch, so in this case R525. Using newer drivers will **NOT WORK** and maybe even make your VM crash.
If you accidentally installed such a driver, its best to either remove the driver completely using DDU or just install a fresh windows VM.
The quadro driver for R525 branch can be found [here (for 527.27)](https://www.nvidia.com/Download/driverResults.aspx/196728/en-us/).
## Drawbacks to spoofing
- You do not have **ANY** CUDA support
- It only works for Windows VMs
- FRL (Framerate limiter) does not work, so no matter what settings you use for `frl_config`, it doesn't apply
## Adding a vGPU to a Proxmox VM ## Adding a vGPU to a Proxmox VM
Go to the proxmox webinterface, go to your VM, then to `Hardware`, then to `Add` and select `PCI Device`. Go to the proxmox webinterface, go to your VM, then to `Hardware`, then to `Add` and select `PCI Device`.
@@ -585,6 +590,12 @@ Finish by clicking `Add`, start the VM and install the required drivers. After i
Enjoy your new vGPU VM :) Enjoy your new vGPU VM :)
## Licensing
Usually a license is required to use vGPU, but luckily the community found several ways around that. Spoofing the vGPU instance to a Quadro GPU used to be very popular, but I don't recommend it anymore. I've also removed the related sections from this guide. If you still want it for whatever reason, you can go back in the commit history to find the instructions on how to use that.
The recommended way to get around the license is to set up your own license server. Follow the instructions [here](https://git.collinwebdesigns.de/oscar.krause/fastapi-dls) (or [here](https://gitea.publichub.eu/oscar.krause/fastapi-dls) if the other link is down).
## Common problems ## Common problems
Most problems can be solved by reading the instructions very carefully. For some very common problems, read here: Most problems can be solved by reading the instructions very carefully. For some very common problems, read here:
@@ -598,6 +609,7 @@ Most problems can be solved by reading the instructions very carefully. For some
- Make sure that you don't have unlock disabled if you have a consumer gpu ([more information](#have-a-vgpu-supported-card-read-here)) - Make sure that you don't have unlock disabled if you have a consumer gpu ([more information](#have-a-vgpu-supported-card-read-here))
- vGPU doesn't work on my RTX 3080! What to do? - vGPU doesn't work on my RTX 3080! What to do?
- [Learn to read](#your-rtx-30xx-or-40xx-will-not-work-at-this-point-in-time) - [Learn to read](#your-rtx-30xx-or-40xx-will-not-work-at-this-point-in-time)
- Make sure that you don't have any dummy plugs connected to the GPU ports, they may cause problems as [reported by a user from the vgpu discord](https://discord.com/channels/829786927829745685/1182258311014400040/1187339682082721822)
## Support ## Support
@@ -608,6 +620,10 @@ If something isn't working, please create an issue or join the [Discord server](
When asking for help, please describe your problem in detail instead of just saying "vgpu doesn't work". Usually a rough overview over your system (gpu, mainboard, proxmox version, kernel version, ...) and full output of `dmesg` and/or `journalctl --no-pager -b 0 -u nvidia-vgpu-mgr.service` (<-- this only after starting the VM that causes trouble) is helpful. When asking for help, please describe your problem in detail instead of just saying "vgpu doesn't work". Usually a rough overview over your system (gpu, mainboard, proxmox version, kernel version, ...) and full output of `dmesg` and/or `journalctl --no-pager -b 0 -u nvidia-vgpu-mgr.service` (<-- this only after starting the VM that causes trouble) is helpful.
Please also provide the output of `uname -a` and `cat /proc/cmdline` Please also provide the output of `uname -a` and `cat /proc/cmdline`
## Feed my coffee addiction ☕
If you found this guide helpful and want to support me, please feel free to [buy me a coffee](https://www.buymeacoffee.com/polloloco). Thank you very much!
## Further reading ## Further reading
Thanks to all these people (in no particular order) for making this project possible Thanks to all these people (in no particular order) for making this project possible