I would not recommend using the .run file installer on Ubuntu. They have the driver packaged and tailored for their distro.
Installation either through their software interface or by the graphics drivers ppa.
Looks like you configured PRIME on-demand aka render-offload.
Read here how to use it: https://download.nvidia.com/XFree86/Linux-x86_64/470.74/README/primerenderoffload.html
Use nvidia-smi to see if the driver recognizes the GPU. lsmod|grep nvidia to see if the driver is loaded.
Maybe you actually want to use display-offloading: https://download.nvidia.com/XFree86/Linux-x86_64/470.74/README/randr14.html sudo prime-select nvidia followed by sudo update-initramfs -u and reboot to activate that.
Hi Mart.
Actually, I solved it by inactivating the UEFI security boot. I didn’t try the path that you suggested.
I think the security boot was preventing the Ubuntu to recognize the driver.