Proprietary kernel driver on kernel 6.x and debian bookworm (this is a proposed solution)

I have applied this patch to the driver and it seems to work well

--- nvidia-drm.orig/nvidia-drm-helper.h	2022-08-22 14:52:07.255249844 +0200
+++ nvidia-drm/nvidia-drm-helper.h	2022-08-22 14:50:36.618863332 +0200
@@ -108,6 +108,7 @@ nv_drm_prime_pages_to_sg(struct drm_devi
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 #include <drm/drm_crtc.h>
+#include <drm/drm_framebuffer.h>
 
 #if defined(drm_for_each_plane)
 #define nv_drm_for_each_plane(plane, dev) 

output of nvidia-smi

Mon Aug 22 16:55:39 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0  On |                  N/A |
| N/A   41C    P8    18W /  N/A |    861MiB /  8192MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A     11019      G   /usr/bin/gnome-shell              413MiB |
|    0   N/A  N/A     11730      G   gnome-control-center               48MiB |
|    0   N/A  N/A     11741      G   evolution                           2MiB |
|    0   N/A  N/A     11939      G   /usr/bin/Xwayland                  99MiB |
|    0   N/A  N/A     12292      G   ...762497305674480250,131072      101MiB |
|    0   N/A  N/A     12304      G   ...RendererForSitePerProcess       39MiB |
|    0   N/A  N/A     12326      G   ...AAAAAAAAA= --shared-files        3MiB |
|    0   N/A  N/A     12388      G   ...plications/Zoiper5/zoiper        9MiB |
|    0   N/A  N/A     19825    C+G   ...lib/vmware/bin/mksSandbox       54MiB |
|    0   N/A  N/A    139072      G   ...AAAAAAAAA= --shared-files       41MiB |
+-----------------------------------------------------------------------------+
root@ghost:/usr/src/nvidia-current-515.65.01/patches# 

output of uname -a
Linux ghost 6.0.0-rc2 #1 SMP PREEMPT_DYNAMIC Mon Aug 22 12:03:34 CEST 2022 x86_64 GNU/Linux