Ubuntu 20.04 drivers not working

Hi I can’t seem to get my nvidia drivers working. I reinstalled ubuntu, but they are still not working. Nvidia-smi keeps returning No devices were found.

When run the nvidia-bug-report.sh I get:

*** /var/lib/dkms/nvidia/520.56.06/5.15.0-52-generic/x86_64/log/make.log
*** ls: -rw-r--r-- 1 root root 1134074 2022-11-13 01:08:54.033318955 -0500 /var/lib/dkms/nvidia/520.56.06/5.15.0-52-generic/x86_64/log/make.log
DKMS make.log for nvidia-520.56.06 for kernel 5.15.0-52-generic (x86_64)
Sun 13 Nov 2022 01:08:35 AM EST
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-52-generic'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
echo >&2;							\
echo >&2 "  ERROR: Kernel configuration is invalid.";		\
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
echo >&2 ;							\
/bin/false)
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
  You are using:           cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
make -f ./scripts/Makefile.build obj=/var/lib/dkms/nvidia/520.56.06/build \
single-build= \
need-builtin=1 need-modorder=1
  ln -sf /var/lib/dkms/nvidia/520.56.06/build/nvidia/nv-kernel.o_binary /var/lib/dkms/nvidia/520.56.06/build/nvidia/nv-kernel.o
  ln -sf /var/lib/dkms/nvidia/520.56.06/build/nvidia-modeset/nv-modeset-kernel.o_binary /var/lib/dkms/nvidia/520.56.06/build/nvidia-modeset/nv-modeset-kernel.o

Is there something wrong with my gcc? I tried uninstalling it and reinstalling it, but it didn’t help.
Here is my full log file:
nvidia-bug-report.log (3.9 MB)

Tried reinstalling kernel headers, but that didn’t help

sudo apt install --reinstall linux-image-generic
sudo apt install --reinstall linux-headers-generic

My driver version based off of cat /proc/driver/nvidia/version is:

NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  520.56.06  Release Build  (dvs-builder@U16-T12-10-2)  Thu Oct  6 21:33:54 UTC 2022
GCC version:  gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) 

Has anyone experienced something like this or has advice on how to fix it?

https://forums.developer.nvidia.com/t/nvidia-gtx-1650-ti-driver-cannot-be-installed-on-ubuntu-studio/233636/7?u=generix

After I change the driver it always gets stuck on a purple screen.

Please create a new bug-report.log.

Log file after installing new drivers:
nvidia-bug-report.log (1.7 MB)

I figured it out. Changing the drivers fixed the problem. The login page was just showing on my HDMI dummy plug. Thank you