mirror of
https://gitlab.com/polloloco/vgpu-proxmox.git
synced 2026-04-10 17:25:49 +03:00
Compare commits
27 Commits
proxmox-7.
...
640a834483
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
640a834483 | ||
|
|
8e85d32eb0 | ||
|
|
3110f37d80 | ||
|
|
0c1d8e6bea | ||
|
|
028d78af09 | ||
|
|
9e3df0bdff | ||
|
|
e2955b232a | ||
|
|
a577cc6625 | ||
|
|
df93332349 | ||
|
|
ba197fb9ac | ||
|
|
646e599bce | ||
|
|
0e51ef508e | ||
|
|
dcf58742b8 | ||
|
|
5ec737e1a3 | ||
|
|
d1009fd47a | ||
|
|
8cef2c6082 | ||
|
|
ea99035a5b | ||
|
|
ba4b4b4787 | ||
|
|
22bd687e6d | ||
|
|
f2b1c0c1e9 | ||
|
|
7f5762abb3 | ||
|
|
e811051d09 | ||
|
|
cfd7da5ed2 | ||
|
|
cb0ed9baf3 | ||
|
|
f224154ea5 | ||
|
|
919b49ed74 | ||
|
|
dc9585f91e |
BIN
510.108.03.patch
Normal file
BIN
510.108.03.patch
Normal file
Binary file not shown.
BIN
510.85.03.patch
Normal file
BIN
510.85.03.patch
Normal file
Binary file not shown.
BIN
525.60.12.patch
Normal file
BIN
525.60.12.patch
Normal file
Binary file not shown.
BIN
525.85.07.patch
Normal file
BIN
525.85.07.patch
Normal file
Binary file not shown.
BIN
535.104.06.patch
Normal file
BIN
535.104.06.patch
Normal file
Binary file not shown.
BIN
535.129.03.patch
Normal file
BIN
535.129.03.patch
Normal file
Binary file not shown.
BIN
535.54.06.patch
Normal file
BIN
535.54.06.patch
Normal file
Binary file not shown.
Binary file not shown.
385
README.md
385
README.md
@@ -1,18 +1,45 @@
|
|||||||
# NVIDIA vGPU with the 510 driver
|
# NVIDIA vGPU on Proxmox
|
||||||
|
|
||||||
Thanks to the great work of a `LIL'pingu` in the vgpu unlock discord we can finally use the (at the time of writing) latest NVIDIA GRID driver with the version number 510.47.03 with most consumer GPUs. Personally I have tested the T1000, a turing based card but others from the discord server got it working with a pascal based card as well.
|
[](https://www.buymeacoffee.com/polloloco)
|
||||||
|
|
||||||
### This tutorial assumes you are using a clean install of Proxmox 7.1, or ymmv when using an existing installation. Make sure to always have backups!
|
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.
|
||||||
|
|
||||||
The patch included in this repository should work on other linux systems with kernel versions >= 5.13 but I have only tested it on proxmox.
|
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.
|
||||||
If you are not using proxmox, you have to adapt some parts of this tutorial to work for your distribution.
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
> ## 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 by running `nvidia-uninstall` first.
|
||||||
|
>
|
||||||
|
> 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.
|
||||||
|
>
|
||||||
|
> Either delete the folder `/opt/vgpu_unlock-rs` or enter the folder and run `git pull` and then recompile the library again using `cargo build --release`
|
||||||
|
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
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
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -22,14 +49,7 @@ apt update
|
|||||||
apt dist-upgrade
|
apt dist-upgrade
|
||||||
```
|
```
|
||||||
|
|
||||||
By default Proxmox 7.1 has the 5.13 kernel, but you can opt-in to the newer 5.15 version. Both versions work just fine for vGPU.
|
We need to install a few more packages like git, a compiler and some other tools.
|
||||||
|
|
||||||
If you didn't install a newer kernel on proxmox, then skip the following line. If you have the 5.15 kernel, it is required that you also install the corresponding kernel headers:
|
|
||||||
```bash
|
|
||||||
apt install -y pve-headers-5.15
|
|
||||||
```
|
|
||||||
|
|
||||||
Next we need to install a few more packages like git, a compiler and some other tools. This is required no matter which kernel version you are using.
|
|
||||||
```bash
|
```bash
|
||||||
apt install -y git build-essential dkms pve-headers mdevctl
|
apt install -y git build-essential dkms pve-headers mdevctl
|
||||||
```
|
```
|
||||||
@@ -38,18 +58,18 @@ apt install -y git build-essential dkms pve-headers mdevctl
|
|||||||
|
|
||||||
First, clone this repo to your home folder (in this case `/root/`)
|
First, clone this repo to your home folder (in this case `/root/`)
|
||||||
```bash
|
```bash
|
||||||
git clone https://gitlab.com/polloloco/vgpu-5.15.git
|
git clone https://gitlab.com/polloloco/vgpu-proxmox.git
|
||||||
```
|
```
|
||||||
|
|
||||||
You also need the vgpu_unlock-rs repo
|
You also need the vgpu_unlock-rs repo
|
||||||
```bash
|
```bash
|
||||||
cd /opt
|
cd /opt
|
||||||
git clone https://github.com/p0lloloco/vgpu_unlock-rs
|
git clone https://github.com/mbilker/vgpu_unlock-rs.git
|
||||||
```
|
```
|
||||||
|
|
||||||
After that, install the rust compiler
|
After that, install the rust compiler
|
||||||
```bash
|
```bash
|
||||||
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
|
||||||
```
|
```
|
||||||
|
|
||||||
Now make the rust binaries available in your $PATH (you only have to do it the first time after installing rust)
|
Now make the rust binaries available in your $PATH (you only have to do it the first time after installing rust)
|
||||||
@@ -80,6 +100,14 @@ echo -e "[Service]\nEnvironment=LD_PRELOAD=/opt/vgpu_unlock-rs/target/release/li
|
|||||||
echo -e "[Service]\nEnvironment=LD_PRELOAD=/opt/vgpu_unlock-rs/target/release/libvgpu_unlock_rs.so" > /etc/systemd/system/nvidia-vgpu-mgr.service.d/vgpu_unlock.conf
|
echo -e "[Service]\nEnvironment=LD_PRELOAD=/opt/vgpu_unlock-rs/target/release/libvgpu_unlock_rs.so" > /etc/systemd/system/nvidia-vgpu-mgr.service.d/vgpu_unlock.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> ### 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 [Enabling IOMMU](#enabling-iommu)
|
||||||
|
>
|
||||||
|
> Disable the unlock part as doing this on a gpu that already supports vgpu, could break things as it introduces unnecessary complexity and more points of possible failure:
|
||||||
|
> ```bash
|
||||||
|
> echo "unlock = false" > /etc/vgpu_unlock/config.toml
|
||||||
|
> ```
|
||||||
|
|
||||||
## Enabling IOMMU
|
## Enabling IOMMU
|
||||||
#### Note: Usually this isn't required for vGPU to work, but it doesn't hurt to enable it. You can skip this section, but if you run into problems later on, make sure to enable IOMMU.
|
#### Note: Usually this isn't required for vGPU to work, but it doesn't hurt to enable it. You can skip this section, but if you run into problems later on, make sure to enable IOMMU.
|
||||||
@@ -107,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 lose 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:
|
||||||
@@ -141,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 lose 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:
|
||||||
@@ -225,42 +259,90 @@ 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 (March 2022), the latest available GRID driver is 14.0 with vGPU driver version 510.47.03. You can check for the latest version [here](https://docs.nvidia.com/grid/). I cannot guarantee that newer versions would work without additional patches, this tutorial only covers 14.0 (510.47.03).
|
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
|
||||||
|
|
||||||
NVIDIA doesn't let you freely download vGPU drivers like they do with GeForce or normal Quadro drivers, instead you have to download them through the [NVIDIA Licensing Portal](https://nvid.nvidia.com/dashboard/) (see: [https://www.nvidia.com/en-us/drivers/vgpu-software-driver/](https://www.nvidia.com/en-us/drivers/vgpu-software-driver/)). You can sign up for a free evaluation to get access to the download page.
|
NVIDIA doesn't let you freely download vGPU drivers like they do with GeForce or normal Quadro drivers, instead you have to download them through the [NVIDIA Licensing Portal](https://nvid.nvidia.com/dashboard/) (see: [https://www.nvidia.com/en-us/drivers/vgpu-software-driver/](https://www.nvidia.com/en-us/drivers/vgpu-software-driver/)). You can sign up for a free evaluation to get access to the download page.
|
||||||
|
|
||||||
The file you are looking for is called `NVIDIA-GRID-Linux-KVM-510.47.03-511.65.zip`, you can get it from the download portal by downloading version 14.0 for `Linux KVM`.
|
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.
|
||||||
|
|
||||||
After downloading, extract that and copy the file `NVIDIA-Linux-x86_64-510.47.03-vgpu-kvm.run` to your Proxmox host into the `/root/` folder
|
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:
|
||||||
```bash
|
|
||||||
scp NVIDIA-Linux-x86_64-510.47.03-vgpu-kvm.run root@pve:/root/
|

|
||||||
```
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### ⚠️ From here on, I will be using the 16.2 driver, but the steps are the same for other driver versions
|
||||||
|
|
||||||
|
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!
|
||||||
|
>
|
||||||
|
> 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:
|
||||||
|
>
|
||||||
|
> ⚠️
|
||||||
|
> ```bash
|
||||||
|
> chmod +x NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm.run
|
||||||
|
> ./NVIDIA-Linux-x86_64-535.129.03-vgpu-kvm.run --dkms
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> To finish the installation, reboot the system
|
||||||
|
> ```bash
|
||||||
|
> reboot
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Now, skip the following two sections and continue at [Finishing touches](#finishing-touches)
|
||||||
|
|
||||||
### 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-510.47.03-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-510.47.03-vgpu-kvm.run --apply-patch ~/vgpu-5.15/NVIDIA-Linux-x86_64-510.47.03-vgpu-kvm.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-510.47.03-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-510.47.03-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-510.47.03-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`.
|
||||||
@@ -269,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: 510.47.03) 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.
|
||||||
@@ -288,16 +370,16 @@ nvidia-smi
|
|||||||
|
|
||||||
You should get an output similar to this one
|
You should get an output similar to this one
|
||||||
```
|
```
|
||||||
Fri Mar 25 11:39:40 2022
|
Tue Jan 24 20:21:28 2023
|
||||||
+-----------------------------------------------------------------------------+
|
+-----------------------------------------------------------------------------+
|
||||||
| NVIDIA-SMI 510.47.03 Driver Version: 510.47.03 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. |
|
||||||
| | | MIG M. |
|
| | | MIG M. |
|
||||||
|===============================+======================+======================|
|
|===============================+======================+======================|
|
||||||
| 0 NVIDIA T1000 On | 00000000:01:00.0 Off | N/A |
|
| 0 NVIDIA GeForce ... On | 00000000:01:00.0 Off | N/A |
|
||||||
| 0% 36C P8 N/A / 50W | 35MiB / 4096MiB | 0% Default |
|
| 26% 33C P8 43W / 260W | 85MiB / 11264MiB | 0% Default |
|
||||||
| | | N/A |
|
| | | N/A |
|
||||||
+-------------------------------+----------------------+----------------------+
|
+-------------------------------+----------------------+----------------------+
|
||||||
|
|
||||||
@@ -338,38 +420,30 @@ The output will be similar to this
|
|||||||
|
|
||||||
If this command doesn't return any output, vGPU unlock isn't working.
|
If this command doesn't return any output, vGPU unlock isn't working.
|
||||||
|
|
||||||
### Bonus: working `nvidia-smi vgpu` command
|
Another command you can try to see if your card is recognized as being vgpu enabled is this one:
|
||||||
|
```bash
|
||||||
I've included an adapted version of the `nvidia-smi` [wrapper script](https://github.com/erin-allison/nvidia-merged-arch/blob/d2ce752cd38461b53b7e017612410a3348aa86e5/nvidia-smi) to get useful output from `nvidia-smi vgpu`.
|
nvidia-smi vgpu
|
||||||
|
|
||||||
Without that wrapper script, running `nvidia-smi vgpu` in your shell results in this output
|
|
||||||
```
|
|
||||||
No supported devices in vGPU mode
|
|
||||||
```
|
```
|
||||||
|
|
||||||
With the wrapper script, the output looks similar to this
|
If everything worked right with the unlock, the output should be similar to this:
|
||||||
```
|
```
|
||||||
Fri Mar 25 11:40:18 2022
|
Tue Jan 24 20:21:43 2023
|
||||||
+-----------------------------------------------------------------------------+
|
+-----------------------------------------------------------------------------+
|
||||||
| NVIDIA-SMI 510.47.03 Driver Version: 510.47.03 |
|
| 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 |
|
||||||
|=================================+==============================+============|
|
|=================================+==============================+============|
|
||||||
| 0 NVIDIA T1000 | 00000000:01:00.0 | 0% |
|
| 0 NVIDIA GeForce RTX 208... | 00000000:01:00.0 | 0% |
|
||||||
+---------------------------------+------------------------------+------------+
|
+---------------------------------+------------------------------+------------+
|
||||||
```
|
```
|
||||||
|
|
||||||
To install this script, copy the `nvidia-smi` file from this repo to `/usr/local/bin` and make it executable
|
However, if you get this output, then something went wrong
|
||||||
```bash
|
```
|
||||||
cp ~/vgpu-5.15/nvidia-smi /usr/local/bin/
|
No supported devices in vGPU mode
|
||||||
chmod +x /usr/local/bin/nvidia-smi
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Run this in your shell (you might have to logout and back in first) to see if it worked
|
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.
|
||||||
```bash
|
|
||||||
nvidia-smi vgpu
|
|
||||||
```
|
|
||||||
|
|
||||||
## vGPU overrides
|
## vGPU overrides
|
||||||
|
|
||||||
@@ -377,6 +451,14 @@ Further up we have created the file `/etc/vgpu_unlock/profile_override.toml` and
|
|||||||
|
|
||||||
If we take a look at the output of `mdevctl types` we see lots of different types that we can choose from. However, if we for example chose `GRID RTX6000-4Q` which gives us 4GB of vram in a VM, we are locked to that type for all of our VMs. Meaning we can only have 4GB VMs, its not possible to mix different types to have one 4GB VM, and two 2GB VMs.
|
If we take a look at the output of `mdevctl types` we see lots of different types that we can choose from. However, if we for example chose `GRID RTX6000-4Q` which gives us 4GB of vram in a VM, we are locked to that type for all of our VMs. Meaning we can only have 4GB VMs, its not possible to mix different types to have one 4GB VM, and two 2GB VMs.
|
||||||
|
|
||||||
|
> ### Important notes
|
||||||
|
>
|
||||||
|
> Q profiles *can* give you horrible performance in OpenGL applications/games. To fix that, switch to an equivalent A or B profile (for example `GRID RTX6000-4B`)
|
||||||
|
>
|
||||||
|
> C profiles (for example `GRID RTX6000-4C`) only work on Linux, don't try using those on Windows, it will not work - at all.
|
||||||
|
>
|
||||||
|
> A profiles (for example `GRID RTX6000-4A`) will NOT work on Linux, they only work on Windows.
|
||||||
|
|
||||||
All of that changes with the override config file. Technically we are still locked to only using one profile, but now its possible to change the vram of the profile on a VM basis so even though we have three `GRID RTX6000-4Q` instances, one VM can have 4GB or vram but we can override the vram size for the other two VMs to only 2GB.
|
All of that changes with the override config file. Technically we are still locked to only using one profile, but now its possible to change the vram of the profile on a VM basis so even though we have three `GRID RTX6000-4Q` instances, one VM can have 4GB or vram but we can override the vram size for the other two VMs to only 2GB.
|
||||||
|
|
||||||
Lets take a look at this example config override file (its in TOML format)
|
Lets take a look at this example config override file (its in TOML format)
|
||||||
@@ -388,22 +470,21 @@ display_height = 1080 # Maximum display height in the VM
|
|||||||
max_pixels = 2073600 # This is the product of display_width and display_height so 1920 * 1080 = 2073600
|
max_pixels = 2073600 # This is the product of display_width and display_height so 1920 * 1080 = 2073600
|
||||||
cuda_enabled = 1 # Enables CUDA support. Either 1 or 0 for enabled/disabled
|
cuda_enabled = 1 # Enables CUDA support. Either 1 or 0 for enabled/disabled
|
||||||
frl_enabled = 1 # This controls the frame rate limiter, if you enable it your fps in the VM get locked to 60fps. Either 1 or 0 for enabled/disabled
|
frl_enabled = 1 # This controls the frame rate limiter, if you enable it your fps in the VM get locked to 60fps. Either 1 or 0 for enabled/disabled
|
||||||
framebuffer = 0x76000000 # VRAM size for the VM. In this case its 2GB
|
framebuffer = 0x74000000
|
||||||
# Other options:
|
framebuffer_reservation = 0xC000000 # In combination with the framebuffer size
|
||||||
# 1GB: 0x3B000000
|
# above, these two lines will give you a VM
|
||||||
# 2GB: 0x76000000
|
# with 2GB of VRAM (framebuffer + framebuffer_reservation = VRAM size in bytes).
|
||||||
# 3GB: 0xB1000000
|
# See below for some other sizes
|
||||||
# 4GB: 0xEC000000
|
|
||||||
# 8GB: 0x1D8000000
|
|
||||||
# 16GB: 0x3B0000000
|
|
||||||
|
|
||||||
[mdev.00000000-0000-0000-0000-000000000100]
|
[vm.100]
|
||||||
frl_enabled = 0
|
frl_enabled = 0
|
||||||
# You can override all the options from above here too. If you want to add more overrides for a new VM, just copy this block and change the UUID
|
# You can override all the options from above here too. If you want to add more overrides for a new VM, just copy this block and change the VM ID
|
||||||
```
|
```
|
||||||
|
|
||||||
There are two blocks here, the first being `[profile.nvidia-259]` and the second `[mdev.00000000-0000-0000-0000-000000000100]`.
|
There are two blocks here, the first being `[profile.nvidia-259]` and the second `[vm.100]`.
|
||||||
The first one applies the overrides to all VM instances of the `nvidia-259` type (thats `GRID RTX6000-4Q`) and the second one applies its overrides only to one specific VM, that one with the uuid `00000000-0000-0000-0000-000000000100`.
|
The first one applies the overrides to all VM instances of the `nvidia-259` type (thats `GRID RTX6000-4Q`) and the second one applies its overrides only to one specific VM, that one with the proxmox VM ID `100`.
|
||||||
|
|
||||||
|
The proxmox VM ID is the same number that you see in the proxmox webinterface, next to the VM name.
|
||||||
|
|
||||||
You don't have to specify all parameters, only the ones you need/want. There are some more that I didn't mention here, you can find them by going through the source code of the `vgpu_unlock-rs` repo.
|
You don't have to specify all parameters, only the ones you need/want. There are some more that I didn't mention here, you can find them by going through the source code of the `vgpu_unlock-rs` repo.
|
||||||
|
|
||||||
@@ -416,55 +497,91 @@ display_height = 1080
|
|||||||
max_pixels = 2073600
|
max_pixels = 2073600
|
||||||
```
|
```
|
||||||
|
|
||||||
### Spoofing your vGPU instance
|
### Common VRAM sizes
|
||||||
|
|
||||||
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.
|
Here are some common framebuffer sizes that you might want to use:
|
||||||
|
|
||||||
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:
|
- 512MB:
|
||||||
```toml
|
```toml
|
||||||
[profile.nvidia-259]
|
framebuffer = 0x1A000000
|
||||||
# insert all of your other overrides here too
|
framebuffer_reservation = 0x6000000
|
||||||
pci_device_id = 0x1E30
|
```
|
||||||
pci_id = 0x1E3012BA # This is not always required, see below
|
- 1GB:
|
||||||
```
|
```toml
|
||||||
|
framebuffer = 0x38000000
|
||||||
|
framebuffer_reservation = 0x8000000
|
||||||
|
```
|
||||||
|
- 2GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x74000000
|
||||||
|
framebuffer_reservation = 0xC000000
|
||||||
|
```
|
||||||
|
- 3GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0xB0000000
|
||||||
|
framebuffer_reservation = 0x10000000
|
||||||
|
```
|
||||||
|
- 4GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0xEC000000
|
||||||
|
framebuffer_reservation = 0x14000000
|
||||||
|
```
|
||||||
|
- 5GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x128000000
|
||||||
|
framebuffer_reservation = 0x18000000
|
||||||
|
```
|
||||||
|
- 6GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x164000000
|
||||||
|
framebuffer_reservation = 0x1C000000
|
||||||
|
```
|
||||||
|
- 8GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x1DC000000
|
||||||
|
framebuffer_reservation = 0x24000000
|
||||||
|
```
|
||||||
|
- 10GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x254000000
|
||||||
|
framebuffer_reservation = 0x2C000000
|
||||||
|
```
|
||||||
|
- 12GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x2CC000000
|
||||||
|
framebuffer_reservation = 0x34000000
|
||||||
|
```
|
||||||
|
- 16GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x3BC000000
|
||||||
|
framebuffer_reservation = 0x44000000
|
||||||
|
```
|
||||||
|
- 20GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x4AC000000
|
||||||
|
framebuffer_reservation = 0x54000000
|
||||||
|
```
|
||||||
|
- 24GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x59C000000
|
||||||
|
framebuffer_reservation = 0x64000000
|
||||||
|
```
|
||||||
|
- 32GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0x77C000000
|
||||||
|
framebuffer_reservation = 0x84000000
|
||||||
|
```
|
||||||
|
- 48GB:
|
||||||
|
```toml
|
||||||
|
framebuffer = 0xB2D200000
|
||||||
|
framebuffer_reservation = 0xD2E00000
|
||||||
|
```
|
||||||
|
|
||||||
`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`.
|
`framebuffer` and `framebuffer_reservation` will always equal the VRAM size in bytes when added together.
|
||||||
|
|
||||||
`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 can remove the `pci_id` entry from above. 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).
|
|
||||||
|
|
||||||
## Adding a vGPU to a Proxmox VM
|
## Adding a vGPU to a Proxmox VM
|
||||||
|
|
||||||
There is only one thing you have to do from the commandline: Open the VM config file and give the VM a uuid.
|
Go to the proxmox webinterface, go to your VM, then to `Hardware`, then to `Add` and select `PCI Device`.
|
||||||
|
|
||||||
For that you need your VM ID, in this example I'm using `1000`.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nano /etc/pve/qemu-server/<VM-ID>.conf
|
|
||||||
```
|
|
||||||
|
|
||||||
So with the VM ID 1000, I have to do this:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nano /etc/pve/qemu-server/1000.conf
|
|
||||||
```
|
|
||||||
|
|
||||||
In that file, you have to add a new line at the end:
|
|
||||||
```
|
|
||||||
args: -uuid 00000000-0000-0000-0000-00000000XXXX
|
|
||||||
```
|
|
||||||
|
|
||||||
You have to replace `XXXX` with your VM ID. With my 1000 ID I have to use this line:
|
|
||||||
```
|
|
||||||
args: -uuid 00000000-0000-0000-0000-000000001000
|
|
||||||
```
|
|
||||||
|
|
||||||
Save and exit from the editor. Thats all you have to do from the terminal.
|
|
||||||
|
|
||||||
Now go to the proxmox webinterface, go to your VM, then to `Hardware`, then to `Add` and select `PCI Device`.
|
|
||||||
You should be able to choose from a list of pci devices. Choose your GPU there, its entry should say `Yes` in the `Mediated Devices` column.
|
You should be able to choose from a list of pci devices. Choose your GPU there, its entry should say `Yes` in the `Mediated Devices` column.
|
||||||
|
|
||||||
Now you should be able to also select the `MDev Type`. Choose whatever profile you want, if you don't remember which one you want, you can see the list of all available types with `mdevctl types`.
|
Now you should be able to also select the `MDev Type`. Choose whatever profile you want, if you don't remember which one you want, you can see the list of all available types with `mdevctl types`.
|
||||||
@@ -473,7 +590,41 @@ Finish by clicking `Add`, start the VM and install the required drivers. After i
|
|||||||
|
|
||||||
Enjoy your new vGPU VM :)
|
Enjoy your new vGPU VM :)
|
||||||
|
|
||||||
## Credits
|
## 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
|
||||||
|
|
||||||
|
Most problems can be solved by reading the instructions very carefully. For some very common problems, read here:
|
||||||
|
|
||||||
|
- The nvidia driver won't install/load
|
||||||
|
- If you were using gpu passthrough before, revert **ALL** of the steps you did or start with a fresh proxmox installation. If you run `lspci -knnd 10de:` and see `vfio-pci` under `Kernel driver in use:` then you have to fix that
|
||||||
|
- Make sure that you are using a supported kernel version (check `uname -a`)
|
||||||
|
- My OpenGL performance is absolute garbage, what can I do?
|
||||||
|
- Read [here](#important-notes)
|
||||||
|
- `mdevctl types` doesn't output anything, how to fix it?
|
||||||
|
- 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?
|
||||||
|
- [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
|
||||||
|
|
||||||
|
If something isn't working, please create an issue or join the [Discord server](https://discord.gg/5rQsSV3Byq) and ask for help in the `#proxmox-support` channel so that the community can help you.
|
||||||
|
|
||||||
|
> ### DO NOT SEND ME A DM, I'M NOT YOUR PERSONAL SUPPORT
|
||||||
|
|
||||||
|
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`
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
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
|
||||||
- [DualCoder](https://github.com/DualCoder) for his original [vgpu_unlock](https://github.com/DualCoder/vgpu_unlock) repo with the kernel hooks
|
- [DualCoder](https://github.com/DualCoder) for his original [vgpu_unlock](https://github.com/DualCoder/vgpu_unlock) repo with the kernel hooks
|
||||||
@@ -483,7 +634,7 @@ Thanks to all these people (in no particular order) for making this project poss
|
|||||||
- [rupansh](https://github.com/rupansh) for the original [twelve.patch](https://github.com/rupansh/vgpu_unlock_5.12/blob/master/twelve.patch) to patch the driver on kernels >= 5.12
|
- [rupansh](https://github.com/rupansh) for the original [twelve.patch](https://github.com/rupansh/vgpu_unlock_5.12/blob/master/twelve.patch) to patch the driver on kernels >= 5.12
|
||||||
- mbuchel#1878 on the [GPU Unlocking discord](https://discord.gg/5rQsSV3Byq) for [fourteen.patch](https://gist.github.com/erin-allison/5f8acc33fa1ac2e4c0f77fdc5d0a3ed1) to patch the driver on kernels >= 5.14
|
- mbuchel#1878 on the [GPU Unlocking discord](https://discord.gg/5rQsSV3Byq) for [fourteen.patch](https://gist.github.com/erin-allison/5f8acc33fa1ac2e4c0f77fdc5d0a3ed1) to patch the driver on kernels >= 5.14
|
||||||
- [erin-allison](https://github.com/erin-allison) for the [nvidia-smi wrapper script](https://github.com/erin-allison/nvidia-merged-arch/blob/d2ce752cd38461b53b7e017612410a3348aa86e5/nvidia-smi)
|
- [erin-allison](https://github.com/erin-allison) for the [nvidia-smi wrapper script](https://github.com/erin-allison/nvidia-merged-arch/blob/d2ce752cd38461b53b7e017612410a3348aa86e5/nvidia-smi)
|
||||||
- LIL'pingu#9069 on the [GPU Unlocking discord](https://discord.gg/5rQsSV3Byq) for his patch to nop out code that NVIDIA added to prevent usage of drivers with a version >= 460 with consumer cards
|
- LIL'pingu#9069 on the [GPU Unlocking discord](https://discord.gg/5rQsSV3Byq) for his patch to nop out code that NVIDIA added to prevent usage of drivers with a version 460 - 470 with consumer cards
|
||||||
|
|
||||||
If I forgot to mention someone, please create an issue or let me know otherwise.
|
If I forgot to mention someone, please create an issue or let me know otherwise.
|
||||||
|
|
||||||
|
|||||||
BIN
downloading_driver.mp4
Normal file
BIN
downloading_driver.mp4
Normal file
Binary file not shown.
12
nvidia-smi
12
nvidia-smi
@@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/bash
|
|
||||||
|
|
||||||
for a in $*
|
|
||||||
do
|
|
||||||
case $a in
|
|
||||||
vgpu)
|
|
||||||
export LD_PRELOAD="/opt/vgpu_unlock-rs/target/release/libvgpu_unlock_rs.so"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
exec /usr/bin/nvidia-smi $@
|
|
||||||
Reference in New Issue
Block a user