NVIDIA Optimus Laptop black screen or blank screen after nvidia graphic driver installation. What is the proper way to set X11?

Hi experts.

My laptop has RTX 4050 GPU and I am using Ubuntu 20.04.
Formerly, I did not have any problem using the GPU for rendering the monitor and use on-demand acceleration for other purposes, but suddenly It cannot and I re-installed the NVIDIA-graphic driver, which shows the black screen.

I tried

  1. turning off nouveau,
  2. set nvidia-drm.modeset=1 in /etc/default/grub
  3. Set xorg.conf file and autostart script as this post: Official driver 384.59 with GeForce 1050m doesn't work on openSUSE Tumbleweed KDE this post

But the screen does not come back.

Here I attach the nvidia-bug-report.log.gz file after deleting all blacklist and xorg.conf files.
nvidia-bug-report.log.gz (329.1 KB)

Why ubuntu 20.04? that might be a major hold back in compatibility.
What version of the drivers are you on?
Also xorg.conf these days are rather a thing of the past avoid using it, if possible.