You would need at least an R530 (530.xx.xx) driver for CUDA 12.1 see heretable 3. (in the general case, that is, not considering the use of compatibility libraries. The compatibility library path is not available for your GeForce card.)
$ sudo apt install nvidia-driver-530
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:
The following packages have unmet dependencies:
libnvidia-extra-525 : Conflicts: libnvidia-extra
libnvidia-extra-530 : Conflicts: libnvidia-extra
nvidia-kernel-common-525 : Conflicts: nvidia-kernel-common
nvidia-kernel-common-530 : Conflicts: nvidia-kernel-common
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Installing via package manager means that the history of the machine matters. I won’t be able to walk you through this in detail, as the way that I know of to solve it is a matter of trial and testing. The basic process I would follow is covered here. I’m unlikely to be able to offer further suggestions, I usually find that I have to be sitting at the machine running commands in order to make sense of it. But the process of chasing the dependency chain is fairly mechanical.