Proxmox 8.0.4 + Kernel 6.2.16-10 + Nvidia P4 + LXC
Just wasted to much time to get this working, simply because the Nvidia driver download screen returns the wrong version!
Reloaded my home server yesterday to get up to the new Proxmox 8, and then had to get the Nvidia P4 card working again.
This is making it work in the host and LXC, and not into VM's for which there are many other guides.
I'm using it only in LXC to accelerate FFMPEG transcoding for video streaming and video conversions.
If you follow the normal process of going to Nvidia website and download drivers, you will get version 460.106.00 of the driver and end up in a loop to get stddef.h to compile the modules.
Now just change the CUDA Toolkit to the latest (12.2), and now suddenly you get the 535.86.10 driver to download.
This one does install in Proxmox 8 with the proxmox-headers-6.2.16-10-pve, gcc and make dependencies.
I then suggest you follow the guid on https://medium.com/@MARatsimbazafy/journey-to-deep-learning-nvidia-gpu-passthrough-to-lxc-container-97d0bc474957 and rememeber to use cgroup2 and not cgroup.