External monitor not working Nvidia Optimus

I have a Intel/Nvidia Optimus machine with debian linux:
My Nvidia-prime is working properly but my HDMI external monitor is not working(Actually my xrandr can detect HDMI input but the the monitor is still not working)
Screenshot from 2022-06-05 05-18-03
Here is my output from

sudo nvidia-bug-report.sh --safe-mode --extra-system-data
sudo nvidia-bug-report.sh

nvidia-bug-report.log.gz.extra (68.5 KB)
nvidia-bug-report.log.gz (563.1 KB)

Tested solutions:

  1. https://forums.developer.nvidia.com/t/linux-mint-nvidia-driver-loads-with-startx-but-not-on-initial-startup/168262

The driver loads too late, please try embedding it into the initrd, i.e.
add the lines
and run
sudo update-initramfs -u

After this change, my laptop stall with HDMI plugin (external monitor), while the startup goes smooth without HDMI plugin (external monitor)

  1. https://forums.developer.nvidia.com/t/hdmi-output-missing-in-xrandr-command-and-external-monitor-does-not-work/68011/3
    I could not work this solution, because my grep modeset /etc/modprobe.d/* does not return expected output and none of the file contains options nvidia-drm modeset=1
$ grep modeset /etc/modprobe.d/*
/etc/modprobe.d/nvidia.conf:install nvidia-modeset modprobe nvidia ; modprobe -i nvidia-legacy-390xx-modeset $CMDLINE_OPTS
/etc/modprobe.d/nvidia.conf:install nvidia-drm modprobe nvidia-modeset ; modprobe -i nvidia-legacy-390xx-drm $CMDLINE_OPTS
/etc/modprobe.d/nvidia.conf:remove nvidia modprobe -r -i nvidia-drm nvidia-modeset nvidia-uvm nvidia
/etc/modprobe.d/nvidia.conf:remove nvidia-modeset modprobe -r -i nvidia-drm nvidia-modeset