I had written a post on the Proxmox forum about this, but wanted to write this page here (mainly for my reference). https://forum.proxmox.com/threads/pve-8-22-kernel-6-8-and-nvidia-vgpu.147039/
This is for enabling Proxmox to use an NVidia GPU (e.g. Tesla P4, M60) and making it available as a ‘virtual gpu’ (vGPU) for virtual machines. This isn’t PCIe passthrough as that only allows one machine to use it at a time. With vGPU you can have multiple systems all using the same GPU at the same time (up to a certain limit based on memory usage)
To begin with, read through this guide:
https://gitlab.com/polloloco/vgpu-proxmox
There is a caveat though with kernel 6.8 and requires a patch. I was able to find the author of a patch to get 16.5 compiling on kernel 6.8. https://gitlab.com/polloloco/vgpu-proxmox/-/merge_requests/9
Patch your downloaded NVidia driver. I went with 16.5 because I have a Tesla P4 card. You can see if your card is supported here: https://docs.nvidia.com/grid/gpus-supported-by-vgpu.html
./NVIDIA-Linux-x86_64-535.161.05-vgpu-kvm.run –apply-patch vGPU-Grid-16.5-535.161.05-Linux-6.8.patch
You should be seeing that the patch applied cleanly.
Then run and install the 16.5 installer:
./NVIDIA-Linux-x86_64-535.161.05-vgpu-kvm-custom.run –dkms -m=kernel
Compiles and installs fine. Proxmox 8.2.2 on Kernel 6.8. mdev devices are available and work well.
It should be noted that I was using this patch against the originally downloaded NVidia host vgpu drivers (16.5) for the card I needed. YMMV if you have a card that needs to have the polloloco applied first. You may also be able to extract the polloloco patched archive and then apply this additional patch (e.g. patch -p1 < vGPU-Grid-16.5-535.161.05-Linux-6.8.patch) and then have a fully patched up source tree. I didn’t test that though since I have the Tesla card. Just wanted to mention that.