NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running

Have a look at the output of :

 /var/log/kern.log:
Aug 22 10:35:10 taihi-Precision-5680 kernel: [    3.899959] nvidia-nvlink: Nvlink Core is being initialized, major device number 505
Aug 22 10:35:10 taihi-Precision-5680 kernel: [    3.951518] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  525.105.17  Tue Mar 28 18:02:59 UTC 2023
Aug 22 10:35:10 taihi-Precision-5680 kernel: [    3.977321] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  525.105.17  Tue Mar 28 22:18:37 UTC 2023
Aug 22 10:35:10 taihi-Precision-5680 kernel: [    4.003195] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
Aug 22 10:35:11 taihi-Precision-5680 kernel: [    4.947435] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
Aug 22 10:35:11 taihi-Precision-5680 kernel: [    5.149596] nvidia-uvm: Loaded the UVM driver, major device number 503.
[...]
Aug 22 10:44:54 taihi-Precision-5680 kernel: [  588.333187] NVRM: API mismatch: the client has the version 525.125.06, but
Aug 22 10:44:54 taihi-Precision-5680 kernel: [  588.333187] NVRM: this kernel module has the version 525.105.17.  Please
Aug 22 10:44:54 taihi-Precision-5680 kernel: [  588.333187] NVRM: make sure that this kernel module and all NVIDIA driver
Aug 22 10:44:54 taihi-Precision-5680 kernel: [  588.333187] NVRM: components have the same version.
Aug 22 10:58:46 taihi-Precision-5680 kernel: [    5.127135] nvidia-nvlink: Nvlink Core is being initialized, major device number 505
Aug 22 10:58:46 taihi-Precision-5680 kernel: [    5.176767] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  535.86.05  Fri Jul 14 20:46:33 UTC 2023
Aug 22 10:58:46 taihi-Precision-5680 kernel: [    5.197558] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  535.86.05  Fri Jul 14 20:20:58 UTC 2023
Aug 22 10:58:46 taihi-Precision-5680 kernel: [    5.230160] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
Aug 22 10:58:47 taihi-Precision-5680 kernel: [    6.144563] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
Aug 22 10:58:47 taihi-Precision-5680 kernel: [    6.454275] nvidia-uvm: Loaded the UVM driver, major device number 503.
Aug 22 10:58:49 taihi-Precision-5680 kernel: [    7.624670] NVRM: API mismatch: the client has the version 535.98, but
Aug 22 10:58:49 taihi-Precision-5680 kernel: [    7.624670] NVRM: this kernel module has the version 535.86.05.  Please
Aug 22 10:58:49 taihi-Precision-5680 kernel: [    7.624670] NVRM: make sure that this kernel module and all NVIDIA driver
Aug 22 10:58:49 taihi-Precision-5680 kernel: [    7.624670] NVRM: components have the same version.

You have 4 different NVIDIA drivers installed. I think you should fix that first.

Please purge ALL NVIDIA drivers cleanly. That means reboot into console mode, unload all NVIDIA related kernel modules, then remove ALL NVIDIA related driver packages. The README file of the downloadable driver packages has detailed instructions and a list of files to look for.

Then reboot again, again into console mode.

Then install ONE correct driver for your system. Either you install the recommended proprietary NVIDIA driver through the Ubuntu Software Center’s Third Party application tab, or you download it as a .run file from Official Drivers | NVIDIA directly, it should be 535.104.05 as we speak.

During installation make sure to follow instructions exactly, especially if you have secure boot enabled and need to authenticate the driver.

I hope this will help you resolve your issues.

Thanks!