This thread is the same issue, please check: https://forums.developer.nvidia.com/t/cannot-get-nvidia-driver-520-515-515-open-or-510-working-in-ubuntu-22-10/231860/30