Nvidia Installation Broken

Hi, first of all I was trying to connect my pc to a second screen, I saw that to do this I have to use Xorg, then next semester I have to use tensorflow for some projects.
The problems concern the installation of nvidia within my operating system

uname -a
Linux parrot 6.5.0-3parrot1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-3parrot1 (2023-10-20) x86_64 GNU/Linux

These problems did not persist in the previous installation.
In fact I have nvidia-settings already installed but it has some problems…
image
In addition I post some additional information

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

┌─[✗]─[giorgiosld@parrot]─[~]
└──╼ $dpkg -l | grep nvidia
ii  firmware-nvidia-gsp                      525.125.06-1~deb12u1                      amd64        NVIDIA GSP firmware
ii  glx-alternative-nvidia                   1.2.2                                     amd64        allows the selection of NVIDIA as GLX provider
ii  libegl-nvidia0:amd64                     525.125.06-1~deb12u1                      amd64        NVIDIA binary EGL library
ii  libgl1-nvidia-glvnd-glx:amd64            525.125.06-1~deb12u1                      amd64        NVIDIA binary OpenGL/GLX library (GLVND variant)
ii  libgles-nvidia1:amd64                    525.125.06-1~deb12u1                      amd64        NVIDIA binary OpenGL|ES 1.x library
ii  libgles-nvidia2:amd64                    525.125.06-1~deb12u1                      amd64        NVIDIA binary OpenGL|ES 2.x library
ii  libglx-nvidia0:amd64                     525.125.06-1~deb12u1                      amd64        NVIDIA binary GLX library
ii  libnvidia-allocator1:amd64               525.125.06-1~deb12u1                      amd64        NVIDIA allocator runtime library
ii  libnvidia-cfg1:amd64                     525.125.06-1~deb12u1                      amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-compiler:amd64                 525.125.06-1~deb12u1                      amd64        NVIDIA runtime compiler library
ii  libnvidia-egl-wayland1:amd64             1:1.1.10-1                                amd64        Wayland EGL External Platform library -- shared library
ii  libnvidia-eglcore:amd64                  525.125.06-1~deb12u1                      amd64        NVIDIA binary EGL core libraries
ii  libnvidia-glcore:amd64                   525.125.06-1~deb12u1                      amd64        NVIDIA binary OpenGL/GLX core libraries
ii  libnvidia-glvkspirv:amd64                525.125.06-1~deb12u1                      amd64        NVIDIA binary Vulkan Spir-V compiler library
ii  libnvidia-ml1:amd64                      525.125.06-1~deb12u1                      amd64        NVIDIA Management Library (NVML) runtime library
ii  libnvidia-nvvm4:amd64                    525.125.06-1~deb12u1                      amd64        NVIDIA NVVM Compiler library
ii  libnvidia-ptxjitcompiler1:amd64          525.125.06-1~deb12u1                      amd64        NVIDIA PTX JIT Compiler library
ii  libnvidia-rtcore:amd64                   525.125.06-1~deb12u1                      amd64        NVIDIA binary Vulkan ray tracing (rtcore) library
ii  mate-sensors-applet-nvidia               1.26.0-1                                  amd64        Display readings from hardware sensors in your MATE panel (NVIDIA sensors)
ii  nvidia-alternative                       525.125.06-1~deb12u1                      amd64        allows the selection of NVIDIA as GLX provider
ii  nvidia-cuda-gdb                          12.0.140~12.0.1-3parrot1                  amd64        NVIDIA CUDA Debugger (GDB)
ii  nvidia-cuda-toolkit-doc                  12.0.1-3parrot1                           all          NVIDIA CUDA and OpenCL documentation
ii  nvidia-detect                            525.125.06-1~deb12u1                      amd64        NVIDIA GPU detection utility
iU  nvidia-driver                            525.125.06-1~deb12u1                      amd64        NVIDIA metapackage
ii  nvidia-driver-bin                        525.125.06-1~deb12u1                      amd64        NVIDIA driver support binaries
ii  nvidia-driver-libs:amd64                 525.125.06-1~deb12u1                      amd64        NVIDIA metapackage (OpenGL/GLX/EGL/GLES libraries)
ii  nvidia-egl-common                        525.125.06-1~deb12u1                      amd64        NVIDIA binary EGL driver - common files
ii  nvidia-egl-icd:amd64                     525.125.06-1~deb12u1                      amd64        NVIDIA EGL installable client driver (ICD)
ii  nvidia-installer-cleanup                 20220217+3~deb12u1                        amd64        cleanup after driver installation with the nvidia-installer
ii  nvidia-kernel-common                     20220217+3~deb12u1                        amd64        NVIDIA binary kernel module support files
iF  nvidia-kernel-dkms                       525.125.06-1~deb12u1                      amd64        NVIDIA binary kernel module DKMS source
ii  nvidia-kernel-support                    525.125.06-1~deb12u1                      amd64        NVIDIA binary kernel module support files
ii  nvidia-legacy-check                      525.125.06-1~deb12u1                      amd64        check for NVIDIA GPUs requiring a legacy driver
ii  nvidia-modprobe                          535.54.03-1~deb12u1                       amd64        utility to load NVIDIA kernel modules and create device nodes
ii  nvidia-opencl-common                     525.125.06-1~deb12u1                      amd64        NVIDIA OpenCL driver - common files
ii  nvidia-persistenced                      525.85.05-1                               amd64        daemon to maintain persistent software state in the NVIDIA driver
ii  nvidia-primus-vk-common                  1.6.2-2                                   amd64        thin wrapper for the NVIDIA binary Vulkan ICD (common files)
ii  nvidia-primus-vk-wrapper:amd64           1.6.2-2                                   amd64        thin wrapper for using the NVIDIA binary Vulkan ICD with bumblebee
ii  nvidia-settings                          525.125.06-1~deb12u1                      amd64        tool for configuring the NVIDIA graphics driver
ii  nvidia-smi                               525.125.06-1~deb12u1                      amd64        NVIDIA System Management Interface
ii  nvidia-support                           20220217+3~deb12u1                        amd64        NVIDIA binary graphics driver support files
ii  nvidia-vdpau-driver:amd64                525.125.06-1~deb12u1                      amd64        Video Decode and Presentation API for Unix - NVIDIA driver
ii  nvidia-vulkan-common                     525.125.06-1~deb12u1                      amd64        NVIDIA Vulkan driver - common files
ii  nvidia-vulkan-icd:amd64                  525.125.06-1~deb12u1                      amd64        NVIDIA Vulkan installable client driver (ICD)
ii  xserver-xorg-video-nvidia                525.125.06-1~deb12u1                      amd64        NVIDIA binary Xorg driver

┌─[giorgiosld@parrot]─[~]
└──╼ $lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)
01:00.1 Audio device: NVIDIA Corporation Device 10fa (rev a1)

neofetch
  `:oho/-`
`mMMMMMMMMMMMNmmdhy-                      giorgiosld@parrot 
 dMMMMMMMMMMMMMMMMMMs`                    ----------------- 
 +MMsohNMMMMMMMMMMMMMm/                   OS: Parrot Security 6.0 (lorikeet) x86_64 
 .My   .+dMMMMMMMMMMMMMh.                 Host: Nitro AN515-54 V1.01 
  +       :NMMMMMMMMMMMMNo                Kernel: 6.5.0-3parrot1-amd64 
           `yMMMMMMMMMMMMMm:              Uptime: 11 hours, 35 mins 
             /NMMMMMMMMMMMMMy`            Packages: 2390 (dpkg) 
              .hMMMMMMMMMMMMMN+           Shell: bash 5.2.15 
                  ``-NMMMMMMMMMd-         Resolution: 1920x1080 
                     /MMMMMMMMMMMs`       DE: MATE 1.26.0 
                      mMMMMMMMsyNMN/      WM: Metacity (Marco) 
                      +MMMMMMMo  :sNh.    Theme: ARK-Dark [GTK2/3] 
                      `NMMMMMMm     -o/   Icons: ara [GTK2/3] 
                       oMMMMMMM.          Terminal: mate-terminal 
                       `NMMMMMM+          Terminal Font: Monospace 13 
                        +MMd/NMh          CPU: Intel i7-9750H (12) @ 4.500GHz 
                         mMm -mN`         GPU: Intel CoffeeLake-H GT2 [UHD Graphics 630] 
                         /MM  `h:         GPU: NVIDIA GeForce GTX 1650 Mobile / Max-Q 
                          dM`   .         Memory: 4030MiB / 15836MiB 
                          :M-
                           d:                                     
                           -+                                     
                            -


As mentioned above, my main goal is to connect a second monitor to the PC, and then in a few months I need to use tensorflow for a university project.
The command I use to download nvidia drivers is as follows

sudo apt install -t lory-backports bumblebee-nvidia primus-nvidia primus-vk-nvidia nvidia-smi nvidia-cuda-dev nvidia-cuda-toolkit
[sudo] password for giorgiosld: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
nvidia-smi is already the newest version (525.125.06-1~deb12u1).
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 to resolve the situation:

The following packages have unmet dependencies:
 nvidia-cuda-dev : Depends: libcu++-dev (>= 1.9.0~) but 1.8.1-2 is to be installed
                   Depends: libcub-dev (>= 2.0.1~) but 1.17.2-2 is to be installed
                   Depends: libthrust-dev (>= 2.0.1~) but 1.17.2-2 is to be installed
                   Recommends: libnvcuvid1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

which is taken from the following guide https://parrotlinux.org/docs/configuration/nvidia-drivers.
Again as mentioned before I had previously followed this guide to install the nvidia driver suite and everything worked including the hdmi connection to the second monitor, then due to a operating system update it no longer worked.
I hope I have provided all the necessary information and that someone can help me. Thank you in advance!

That guide is outdated and wrong unless you have a 12 years old laptop. Please uninstall everything. Then install only the package nvidia-driver and nvidia-smi if that isn’t pulled in automatically.
The driver currently seems to not being loaded, please check disabling secure boot in bios. Otherwise,
Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

Having an external monitor on hybrid graphics also works with wayland as with xorg. To enable hybrid graphics, please set kernel parameter
nvidia-drm.modeset=1
In case of xorg, depending on DE, you’ll have to run
xrandr --setprovideroutputsource 1 0
after login to enable the monitor (put it into autostart). In case of Gnome as DE, it’s not necessary.
Then check out how to use the nvidia gpu
https://http.download.nvidia.com/XFree86/Linux-x86_64/545.29.02/README/primerenderoffload.html

Regarding cuda, don’t use the “nvidia-cuda” named packages, those are debian repackaged cuda packages containing unspecified cuda version, likely not the one you’ll want. In case of tensorflow, just install tensorflow and cuda using anaconda.
If you want a systemwide cuda, add the nvidia repo
https://developer.nvidia.com/cuda-12-0-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Debian&target_version=11&target_type=deb_network
Warning: don’t run

sudo apt-get -y install cuda

like the instructions tell you, this would overwrite the already installed driver, use
sudo apt install cuda-toolkit
to install just the toolkit or, for a specific version
sudo apt install cuda-toolkit-11-3
e.g. for cuda toolkit 11.3