├── 510.108.03.patch ├── 510.85.03.patch ├── 525.60.12.patch ├── 525.85.07.patch ├── 535.54.06.patch ├── README.md └── downloading_driver.mp4 /510.108.03.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProTechEx/vgpu-proxmox/6781aafa22432e381cde8e6813a80faf59b50bc4/510.108.03.patch -------------------------------------------------------------------------------- /510.85.03.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProTechEx/vgpu-proxmox/6781aafa22432e381cde8e6813a80faf59b50bc4/510.85.03.patch -------------------------------------------------------------------------------- /525.60.12.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProTechEx/vgpu-proxmox/6781aafa22432e381cde8e6813a80faf59b50bc4/525.60.12.patch -------------------------------------------------------------------------------- /525.85.07.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProTechEx/vgpu-proxmox/6781aafa22432e381cde8e6813a80faf59b50bc4/525.85.07.patch -------------------------------------------------------------------------------- /535.54.06.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProTechEx/vgpu-proxmox/6781aafa22432e381cde8e6813a80faf59b50bc4/535.54.06.patch -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NVIDIA vGPU on Proxmox 2 | 3 | [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/polloloco) 4 | 5 | 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.0. 6 | 7 | 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. 8 | 9 | ## Supported cards 10 | 11 | The following consumer/not-vGPU-qualified NVIDIA GPUs can be used with vGPU: 12 | - Most GPUs from the Maxwell 2.0 generation (GTX 9xx, Quadro Mxxxx, Tesla Mxx) **EXCEPT the GTX 970** 13 | - All GPUs from the Pascal generation (GTX 10xx, Quadro Pxxxx, Tesla Pxx) 14 | - All GPUs from the Turing generation (GTX 16xx, RTX 20xx, Txxxx) 15 | 16 | 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. 17 | 18 | > **!!! THIS MEANS THAT YOUR RTX 30XX or 40XX WILL NOT WORK !!!** 19 | 20 | This guide and all my tests were done on a RTX 2080 Ti which is based on the Turing architechture. 21 | 22 | ## Important notes before starting 23 | - This tutorial assumes you are using a clean install of Proxmox VE 8.0. 24 | - If you are using Proxmox VE 8.0, you **MUST** use 16.x drivers. Older versions only work with pve 7 25 | - If you tried GPU-passthrough before, you absolutely **MUST** revert all of the steps you did to set that up. 26 | - 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. 27 | - Most of the steps can be applied to other linux distributions, however I'm only covering Proxmox VE here. 28 | 29 | > ## Are you upgrading from a previous version of this guide? 30 | > 31 | > If you are upgrading from a previous version of this guide, you should uninstall the old driver by running `nvidia-uninstall` first. 32 | > 33 | > 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. 34 | > 35 | > 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` 36 | 37 | ## Packages 38 | 39 | 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) 40 | 41 | ```bash 42 | echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" >> /etc/apt/sources.list 43 | rm /etc/apt/sources.list.d/pve-enterprise.list 44 | ``` 45 | 46 | Update and upgrade 47 | ```bash 48 | apt update 49 | apt dist-upgrade 50 | ``` 51 | 52 | We need to install a few more packages like git, a compiler and some other tools. 53 | ```bash 54 | apt install -y git build-essential dkms pve-headers mdevctl 55 | ``` 56 | 57 | ## Git repos and [Rust](https://www.rust-lang.org/) compiler 58 | 59 | First, clone this repo to your home folder (in this case `/root/`) 60 | ```bash 61 | git clone https://gitlab.com/polloloco/vgpu-proxmox.git 62 | ``` 63 | 64 | You also need the vgpu_unlock-rs repo 65 | ```bash 66 | cd /opt 67 | git clone https://github.com/mbilker/vgpu_unlock-rs.git 68 | ``` 69 | 70 | After that, install the rust compiler 71 | ```bash 72 | curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal 73 | ``` 74 | 75 | Now make the rust binaries available in your $PATH (you only have to do it the first time after installing rust) 76 | ```bash 77 | source $HOME/.cargo/env 78 | ``` 79 | 80 | Enter the `vgpu_unlock-rs` directory and compile the library. Depending on your hardware and internet connection that may take a while 81 | ```bash 82 | cd vgpu_unlock-rs/ 83 | cargo build --release 84 | ``` 85 | 86 | ## Create files for vGPU unlock 87 | 88 | The vgpu_unlock-rs library requires a few files and folders in order to work properly, lets create those 89 | 90 | First create the folder for your vgpu unlock config and create an empty config file 91 | ```bash 92 | mkdir /etc/vgpu_unlock 93 | touch /etc/vgpu_unlock/profile_override.toml 94 | ``` 95 | 96 | Then, create folders and files for systemd to load the vgpu_unlock-rs library when starting the nvidia vgpu services 97 | ```bash 98 | mkdir /etc/systemd/system/{nvidia-vgpud.service.d,nvidia-vgpu-mgr.service.d} 99 | echo -e "[Service]\nEnvironment=LD_PRELOAD=/opt/vgpu_unlock-rs/target/release/libvgpu_unlock_rs.so" > /etc/systemd/system/nvidia-vgpud.service.d/vgpu_unlock.conf 100 | 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 101 | ``` 102 | 103 | > ### Have a vgpu supported card? Read here! 104 | > 105 | > 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) 106 | > 107 | > 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: 108 | > ```bash 109 | > echo "unlock = false" > /etc/vgpu_unlock/config.toml 110 | > ``` 111 | 112 | ## Enabling IOMMU 113 | #### 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. 114 | 115 | To enable IOMMU you have to enable it in your BIOS/UEFI first. Due to it being vendor specific, I am unable to provide instructions for that, but usually for Intel systems the option you are looking for is called something like "Vt-d", AMD systems tend to call it "IOMMU". 116 | 117 | After enabling it in your BIOS/UEFI, you also have to enable it in your kernel. Depending on how your system is booting, there are two ways to do that. 118 | 119 | If you installed your system with ZFS-on-root and in UEFI mode, then you are using systemd-boot, everything else is GRUB. GRUB is way more common so if you are unsure, you are probably using that. 120 | 121 | Depending on which system you are using to boot, you have to chose from the following two options: 122 | 123 |
124 | GRUB 125 | 126 | Open the file `/etc/default/grub` in your favorite editor 127 | ```bash 128 | nano /etc/default/grub 129 | ``` 130 | 131 | The kernel parameters have to be appended to the variable `GRUB_CMDLINE_LINUX_DEFAULT`. On a clean installation that line should look like this 132 | ``` 133 | GRUB_CMDLINE_LINUX_DEFAULT="quiet" 134 | ``` 135 | 136 | If you are using an Intel system, append this after `quiet`: 137 | ``` 138 | intel_iommu=on iommu=pt 139 | ``` 140 | 141 | On AMD systems, append this after `quiet`: 142 | ``` 143 | amd_iommu=on iommu=pt 144 | ``` 145 | 146 | The result should look like this (for intel systems): 147 | ``` 148 | GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt" 149 | ``` 150 | 151 | Now, save and exit from the editor using Ctrl+O and then Ctrl+X and then apply your changes: 152 | ```bash 153 | update-grub 154 | ``` 155 |
156 | 157 |
158 | systemd-boot 159 | 160 | The kernel parameters have to be appended to the commandline in the file `/etc/kernel/cmdline`, so open that in your favorite editor: 161 | ```bash 162 | nano /etc/kernel/cmdline 163 | ``` 164 | 165 | On a clean installation the file might look similar to this: 166 | ``` 167 | root=ZFS=rpool/ROOT/pve-1 boot=zfs 168 | ``` 169 | 170 | On Intel systems, append this at the end 171 | ``` 172 | intel_iommu=on iommu=pt 173 | ``` 174 | 175 | For AMD, use this 176 | ``` 177 | amd_iommu=on iommu=pt 178 | ``` 179 | 180 | After editing the file, it should look similar to this 181 | ``` 182 | root=ZFS=rpool/ROOT/pve-1 boot=zfs intel_iommu=on iommu=pt 183 | ``` 184 | 185 | Now, save and exit from the editor using Ctrl+O and then Ctrl+X and then apply your changes: 186 | ```bash 187 | proxmox-boot-tool refresh 188 | ``` 189 |
190 | 191 | ## Loading required kernel modules and blacklisting the open source nvidia driver 192 | 193 | We have to load the `vfio`, `vfio_iommu_type1`, `vfio_pci` and `vfio_virqfd` kernel modules to get vGPU working 194 | ```bash 195 | echo -e "vfio\nvfio_iommu_type1\nvfio_pci\nvfio_virqfd" >> /etc/modules 196 | ``` 197 | 198 | Proxmox comes with the open source nouveau driver for nvidia gpus, however we have to use our patched nvidia driver to enable vGPU. The next line will prevent the nouveau driver from loading 199 | ```bash 200 | echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf 201 | ``` 202 | 203 | ## Applying our kernel configuration 204 | 205 | I'm not sure if this is needed, but it doesn't hurt :) 206 | 207 | ```bash 208 | update-initramfs -u -k all 209 | ``` 210 | 211 | ...and reboot 212 | ```bash 213 | reboot 214 | ``` 215 | 216 | ## Check if IOMMU is enabled 217 | #### Note: See section "Enabling IOMMU", this is optional 218 | 219 | Wait for your server to restart, then type this into a root shell 220 | ```bash 221 | dmesg | grep -e DMAR -e IOMMU 222 | ``` 223 | 224 | On my Intel system the output looks like this 225 | ``` 226 | [ 0.007235] ACPI: DMAR 0x000000009CC98B68 0000B8 (v01 INTEL BDW 00000001 INTL 00000001) 227 | [ 0.007255] ACPI: Reserving DMAR table memory at [mem 0x9cc98b68-0x9cc98c1f] 228 | [ 0.020766] DMAR: IOMMU enabled 229 | [ 0.062294] DMAR: Host address width 39 230 | [ 0.062296] DMAR: DRHD base: 0x000000fed90000 flags: 0x0 231 | [ 0.062300] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap c0000020660462 ecap f0101a 232 | [ 0.062302] DMAR: DRHD base: 0x000000fed91000 flags: 0x1 233 | [ 0.062305] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c20660462 ecap f010da 234 | [ 0.062307] DMAR: RMRR base: 0x0000009cc18000 end: 0x0000009cc25fff 235 | [ 0.062309] DMAR: RMRR base: 0x0000009f000000 end: 0x000000af1fffff 236 | [ 0.062312] DMAR-IR: IOAPIC id 8 under DRHD base 0xfed91000 IOMMU 1 237 | [ 0.062314] DMAR-IR: HPET id 0 under DRHD base 0xfed91000 238 | [ 0.062315] DMAR-IR: x2apic is disabled because BIOS sets x2apic opt out bit. 239 | [ 0.062316] DMAR-IR: Use 'intremap=no_x2apic_optout' to override the BIOS setting. 240 | [ 0.062797] DMAR-IR: Enabled IRQ remapping in xapic mode 241 | [ 0.302431] DMAR: No ATSR found 242 | [ 0.302432] DMAR: No SATC found 243 | [ 0.302433] DMAR: IOMMU feature pgsel_inv inconsistent 244 | [ 0.302435] DMAR: IOMMU feature sc_support inconsistent 245 | [ 0.302436] DMAR: IOMMU feature pass_through inconsistent 246 | [ 0.302437] DMAR: dmar0: Using Queued invalidation 247 | [ 0.302443] DMAR: dmar1: Using Queued invalidation 248 | [ 0.333474] DMAR: Intel(R) Virtualization Technology for Directed I/O 249 | [ 3.990175] i915 0000:00:02.0: [drm] DMAR active, disabling use of stolen memory 250 | ``` 251 | 252 | Depending on your mainboard and cpu, the output will be different, in my output the important line is the third one: `DMAR: IOMMU enabled`. If you see something like that, IOMMU is enabled. 253 | 254 | ## NVIDIA Driver 255 | 256 | 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. 257 | 258 | I've created patches for the following driver versions: 259 | - 16.0 (535.54.06) - Use this if you are on pve 8.0 (kernel 6.2) 260 | - 15.1 (525.85.07) 261 | - 15.0 (525.60.12) 262 | - 14.4 (510.108.03) 263 | - 14.3 (510.108.03) 264 | - 14.2 (510.85.03) 265 | 266 | You can choose which of those you want to use, but generally its recommended to use the latest, most up-to-date version (16.0 in this case). 267 | 268 | 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. 269 | 270 | ### Obtaining the driver 271 | 272 | 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. 273 | 274 | 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. 275 | 276 | HERE IS ALTERNETIVE GIT SOURCE FOR THE DRIVERS: https://github.com/justin-himself/NVIDIA-VGPU-Driver-Archive 277 | 278 | 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: 279 | 280 | ![Video Tutorial to find the right driver](downloading_driver.mp4) 281 | 282 | 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.54.06`) from the `Host_Drivers` folder to your Proxmox host into the `/root/` folder using tools like FileZilla, WinSCP, scp or rsync. 283 | 284 | ### ⚠️ From here on, I will be using the 16.0 driver, but the steps are the same for other driver versions 285 | 286 | For example when I run a command like `chmod +x NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm.run`, you should replace `535.54.06` 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). 287 | 288 | Every step where you potentially have to replace the version name will have this warning emoji next to it: ⚠️ 289 | 290 | > ### Have a vgpu supported card? Read here! 291 | > 292 | > 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) 293 | > 294 | > 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: 295 | > 296 | > ⚠️ 297 | > ```bash 298 | > chmod +x NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm.run 299 | > ./NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm.run --dkms 300 | > ``` 301 | > 302 | > To finish the installation, reboot the system 303 | > ```bash 304 | > reboot 305 | > ``` 306 | > 307 | > Now, skip the following two sections and continue at [Finishing touches](#finishing-touches) 308 | 309 | ### Patching the driver 310 | 311 | Now, on the proxmox host, make the driver executable 312 | 313 | ⚠️ 314 | ```bash 315 | chmod +x NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm.run 316 | ``` 317 | 318 | And then patch it 319 | 320 | ⚠️ 321 | ```bash 322 | ./NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm.run --apply-patch ~/vgpu-proxmox/535.54.06.patch 323 | ``` 324 | That should output a lot of lines ending with 325 | ``` 326 | Self-extractible archive "NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm-custom.run" successfully created. 327 | ``` 328 | 329 | You should now have a file called `NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm-custom.run`, that is your patched driver. 330 | 331 | ### Installing the driver 332 | 333 | Now that the required patch is applied, you can install the driver 334 | 335 | ⚠️ 336 | ```bash 337 | ./NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm-custom.run --dkms 338 | ``` 339 | 340 | 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`. 341 | 342 | Depending on your hardware, the installation could take a minute or two. 343 | 344 | If everything went right, you will be presented with this message. 345 | ``` 346 | Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 535.54.06) is now complete. 347 | ``` 348 | 349 | Click `Ok` to exit the installer. 350 | 351 | To finish the installation, reboot. 352 | ```bash 353 | reboot 354 | ``` 355 | 356 | ### Finishing touches 357 | 358 | Wait for your server to reboot, then type this into the shell to check if the driver install worked 359 | ```bash 360 | nvidia-smi 361 | ``` 362 | 363 | You should get an output similar to this one 364 | ``` 365 | Tue Jan 24 20:21:28 2023 366 | +-----------------------------------------------------------------------------+ 367 | | NVIDIA-SMI 525.85.07 Driver Version: 525.85.07 CUDA Version: N/A | 368 | |-------------------------------+----------------------+----------------------+ 369 | | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | 370 | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | 371 | | | | MIG M. | 372 | |===============================+======================+======================| 373 | | 0 NVIDIA GeForce ... On | 00000000:01:00.0 Off | N/A | 374 | | 26% 33C P8 43W / 260W | 85MiB / 11264MiB | 0% Default | 375 | | | | N/A | 376 | +-------------------------------+----------------------+----------------------+ 377 | 378 | +-----------------------------------------------------------------------------+ 379 | | Processes: | 380 | | GPU GI CI PID Type Process name GPU Memory | 381 | | ID ID Usage | 382 | |=============================================================================| 383 | | No running processes found | 384 | +-----------------------------------------------------------------------------+ 385 | ``` 386 | 387 | To verify if the vGPU unlock worked, type this command 388 | ```bash 389 | mdevctl types 390 | ``` 391 | 392 | The output will be similar to this 393 | ``` 394 | 0000:01:00.0 395 | nvidia-256 396 | Available instances: 24 397 | Device API: vfio-pci 398 | Name: GRID RTX6000-1Q 399 | Description: num_heads=4, frl_config=60, framebuffer=1024M, max_resolution=5120x2880, max_instance=24 400 | nvidia-257 401 | Available instances: 12 402 | Device API: vfio-pci 403 | Name: GRID RTX6000-2Q 404 | Description: num_heads=4, frl_config=60, framebuffer=2048M, max_resolution=7680x4320, max_instance=12 405 | nvidia-258 406 | Available instances: 8 407 | Device API: vfio-pci 408 | Name: GRID RTX6000-3Q 409 | Description: num_heads=4, frl_config=60, framebuffer=3072M, max_resolution=7680x4320, max_instance=8 410 | ---SNIP--- 411 | ``` 412 | 413 | If this command doesn't return any output, vGPU unlock isn't working. 414 | 415 | Another command you can try to see if your card is recognized as being vgpu enabled is this one: 416 | ```bash 417 | nvidia-smi vgpu 418 | ``` 419 | 420 | If everything worked right with the unlock, the output should be similar to this: 421 | ``` 422 | Tue Jan 24 20:21:43 2023 423 | +-----------------------------------------------------------------------------+ 424 | | NVIDIA-SMI 525.85.07 Driver Version: 525.85.07 | 425 | |---------------------------------+------------------------------+------------+ 426 | | GPU Name | Bus-Id | GPU-Util | 427 | | vGPU ID Name | VM ID VM Name | vGPU-Util | 428 | |=================================+==============================+============| 429 | | 0 NVIDIA GeForce RTX 208... | 00000000:01:00.0 | 0% | 430 | +---------------------------------+------------------------------+------------+ 431 | ``` 432 | 433 | However, if you get this output, then something went wrong 434 | ``` 435 | No supported devices in vGPU mode 436 | ``` 437 | 438 | 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. 439 | 440 | ## vGPU overrides 441 | 442 | 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. 443 | 444 | 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. 445 | 446 | > ### Important notes 447 | > 448 | > 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`) 449 | > 450 | > C profiles (for example `GRID RTX6000-4C`) only work on Linux, don't try using those on Windows, it will not work - at all. 451 | > 452 | > A profiles (for example `GRID RTX6000-4A`) will NOT work on Linux, they only work on Windows. 453 | 454 | 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. 455 | 456 | Lets take a look at this example config override file (its in TOML format) 457 | ```toml 458 | [profile.nvidia-259] 459 | num_displays = 1 # Max number of virtual displays. Usually 1 if you want a simple remote gaming VM 460 | display_width = 1920 # Maximum display width in the VM 461 | display_height = 1080 # Maximum display height in the VM 462 | max_pixels = 2073600 # This is the product of display_width and display_height so 1920 * 1080 = 2073600 463 | cuda_enabled = 1 # Enables CUDA support. Either 1 or 0 for enabled/disabled 464 | 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 465 | framebuffer = 0x74000000 466 | framebuffer_reservation = 0xC000000 # In combination with the framebuffer size 467 | # above, these two lines will give you a VM 468 | # with 2GB of VRAM (framebuffer + framebuffer_reservation = VRAM size in bytes). 469 | # See below for some other sizes 470 | 471 | [vm.100] 472 | frl_enabled = 0 473 | # 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 474 | ``` 475 | 476 | There are two blocks here, the first being `[profile.nvidia-259]` and the second `[vm.100]`. 477 | 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`. 478 | 479 | The proxmox VM ID is the same number that you see in the proxmox webinterface, next to the VM name. 480 | 481 | 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. 482 | 483 | For a simple 1080p remote gaming VM I recommend going with something like this 484 | ```toml 485 | [profile.nvidia-259] # choose the profile you want here 486 | num_displays = 1 487 | display_width = 1920 488 | display_height = 1080 489 | max_pixels = 2073600 490 | ``` 491 | 492 | ### Common VRAM sizes 493 | 494 | Here are some common framebuffer sizes that you might want to use: 495 | 496 | - 512MB: 497 | ```toml 498 | framebuffer = 0x1A000000 499 | framebuffer_reservation = 0x6000000 500 | ``` 501 | - 1GB: 502 | ```toml 503 | framebuffer = 0x38000000 504 | framebuffer_reservation = 0x8000000 505 | ``` 506 | - 2GB: 507 | ```toml 508 | framebuffer = 0x74000000 509 | framebuffer_reservation = 0xC000000 510 | ``` 511 | - 3GB: 512 | ```toml 513 | framebuffer = 0xB0000000 514 | framebuffer_reservation = 0x10000000 515 | ``` 516 | - 4GB: 517 | ```toml 518 | framebuffer = 0xEC000000 519 | framebuffer_reservation = 0x14000000 520 | ``` 521 | - 5GB: 522 | ```toml 523 | framebuffer = 0x128000000 524 | framebuffer_reservation = 0x18000000 525 | ``` 526 | - 6GB: 527 | ```toml 528 | framebuffer = 0x164000000 529 | framebuffer_reservation = 0x1C000000 530 | ``` 531 | - 8GB: 532 | ```toml 533 | framebuffer = 0x1DC000000 534 | framebuffer_reservation = 0x24000000 535 | ``` 536 | - 10GB: 537 | ```toml 538 | framebuffer = 0x254000000 539 | framebuffer_reservation = 0x2C000000 540 | ``` 541 | - 12GB: 542 | ```toml 543 | framebuffer = 0x2CC000000 544 | framebuffer_reservation = 0x34000000 545 | ``` 546 | - 16GB: 547 | ```toml 548 | framebuffer = 0x3BC000000 549 | framebuffer_reservation = 0x44000000 550 | ``` 551 | - 20GB: 552 | ```toml 553 | framebuffer = 0x4AC000000 554 | framebuffer_reservation = 0x54000000 555 | ``` 556 | - 24GB: 557 | ```toml 558 | framebuffer = 0x59C000000 559 | framebuffer_reservation = 0x64000000 560 | ``` 561 | - 32GB: 562 | ```toml 563 | framebuffer = 0x77C000000 564 | framebuffer_reservation = 0x84000000 565 | ``` 566 | - 48GB: 567 | ```toml 568 | framebuffer = 0xB2D200000 569 | framebuffer_reservation = 0xD2E00000 570 | ``` 571 | 572 | `framebuffer` and `framebuffer_reservation` will always equal the VRAM size in bytes when added together. 573 | 574 | ## Adding a vGPU to a Proxmox VM 575 | 576 | Go to the proxmox webinterface, go to your VM, then to `Hardware`, then to `Add` and select `PCI Device`. 577 | 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. 578 | 579 | 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`. 580 | 581 | Finish by clicking `Add`, start the VM and install the required drivers. After installing the drivers you can shut the VM down and remove the virtual display adapter by selecting `Display` in the `Hardware` section and selecting `none (none)`. ONLY do that if you have some other way to access the Virtual Machine like Parsec or Remote Desktop because the Proxmox Console won't work anymore. 582 | 583 | Enjoy your new vGPU VM :) 584 | 585 | ## Licensing 586 | 587 | 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. 588 | 589 | 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). 590 | 591 | ## Common problems 592 | 593 | Most problems can be solved by reading the instructions very carefully. For some very common problems, read here: 594 | 595 | - The nvidia driver won't install/load 596 | - 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 597 | - Make sure that you are using a supported kernel version (check `uname -a`) 598 | - My OpenGL performance is absolute garbage, what can I do? 599 | - Read [here](#important-notes) 600 | - `mdevctl types` doesn't output anything, how to fix it? 601 | - Make sure that you don't have unlock disabled if you have a consumer gpu ([more information](#have-a-vgpu-supported-card-read-here)) 602 | - vGPU doesn't work on my RTX 3080! What to do? 603 | - [Learn to read](#your-rtx-30xx-or-40xx-will-not-work-at-this-point-in-time) 604 | 605 | ## Support 606 | 607 | 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. 608 | 609 | > ### DO NOT SEND ME A DM, I'M NOT YOUR PERSONAL SUPPORT 610 | 611 | 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. 612 | Please also provide the output of `uname -a` and `cat /proc/cmdline` 613 | 614 | ## Feed my coffee addiction ☕ 615 | 616 | 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! 617 | 618 | ## Further reading 619 | 620 | Thanks to all these people (in no particular order) for making this project possible 621 | - [DualCoder](https://github.com/DualCoder) for his original [vgpu_unlock](https://github.com/DualCoder/vgpu_unlock) repo with the kernel hooks 622 | - [mbilker](https://github.com/mbilker) for the rust version, [vgpu_unlock-rs](https://github.com/mbilker/vgpu_unlock-rs) 623 | - [KrutavShah](https://github.com/KrutavShah) for the [wiki](https://krutavshah.github.io/GPU_Virtualization-Wiki/) 624 | - [HiFiPhile](https://github.com/HiFiPhile) for the [C version](https://gist.github.com/HiFiPhile/b3267ce1e93f15642ce3943db6e60776) of vgpu unlock 625 | - [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 626 | - 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 627 | - [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) 628 | - 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 629 | 630 | If I forgot to mention someone, please create an issue or let me know otherwise. 631 | 632 | ## Contributing 633 | Pull requests are welcome (factual errors, amendments, grammar/spelling mistakes etc). 634 | -------------------------------------------------------------------------------- /downloading_driver.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProTechEx/vgpu-proxmox/6781aafa22432e381cde8e6813a80faf59b50bc4/downloading_driver.mp4 --------------------------------------------------------------------------------