Current (2021-10-11) Debian testing cannot install Nvidia drivers properly. There bug report 994860, which contains a patch.
Here are the steps I took to apply that patch and make things work.
Download the fix-kernel514.patch
from this Gist.
Then run these commands:
$ sudo apt install nvidia-installer-cleanup glx-alternative-nvidia update-glx glx-diversions glx-alternative-mesa nvidia-support nvidia-kernel-common nvidia-modprobe xserver-xorg-core libvdpau1
$ sudo apt-get build-dep nvidia-kernel-dkms
$ apt-get source nvidia-kernel-dkms
$ cd ./nvidia-graphics-drivers-470.57.02
$ cp ../fix-kernel514.patch ./debian/patches/
$ echo 'fix-kernel514.patch' >> ./debian/patches/series-postunpack
$ debuild -us -uc
$ sudo dpkg -i nvidia-kernel-support_470.57.02-2_amd64.deb libgl1-nvidia-glvnd-glx_470.57.02-2_amd64.deb nvidia-driver-libs_470.57.02-2_amd64.deb xserver-xorg-video-nvidia_470.57.02-2_amd64.deb nvidia-vdpau-driver_470.57.02-2_amd64.deb nvidia-driver_470.57.02-2_amd64.deb nvidia-kernel-dkms_470.57.02-2_amd64.deb
If you need OpenCL:
$ sudo dpkg -i nvidia-libopencl1_470.57.02-2_amd64.deb nvidia-opencl-common_470.57.02-2_amd64.deb nvidia-opencl-icd_470.57.02-2_amd64.deb
$ sudo apt install nvidia-opencl-dev
I've re-installed a lot of things, so it can well be that some things that need to be installed are missing. Please report those.