How to install Nvidia drivers on dual GPU Dell XPS 17 laptop?

I just recently installed Rocky Linux for the first time and I haven’t been able to get the Nvidia GPU to work on my laptop. The same Rocky Linux installation works fine on a desktop PC with only a dedicated Nvidia GPU, but on a Dell XPS 17 with dual integrated Intel and dedicated Nvidia RTX4070 GPUs, I’m unable to get it working. Blender is unable to see the Nvidia GPU. I’ve followed several tutorials online that, again, work on the desktop but there’s no mention of dual GPU setup. I’ll appreciate any help.

Is there a way of telling Rocky linux to use the Nvidia GPU?

UPDATE: I installed Ubuntu 24.0 and out of the box the Nvidia GPU works and Blender sees it. So it should be possible, I’m just not too familiar with RHEL based distros so not sure how to proceed. I must use Rocky Linux for teaching.

Some extra info:

# lshw -C display
  *-display                 
       description: 3D controller
       product: AD106M [GeForce RTX 4070 Max-Q / Mobile]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: /dev/fb0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list fb
       configuration: depth=32 latency=0 mode=1920x1200 visual=truecolor xres=1920 yres=1200
       resources: iomemory:600-5ff iomemory:620-61f memory:ab000000-abffffff memory:6000000000-61ffffffff memory:6200000000-6201ffffff ioport:3000(size=128)
  *-display
       description: VGA compatible controller
       product: Raptor Lake-P [Iris Xe Graphics]
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       logical name: /dev/fb0
       version: 04
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=i915 latency=0 resolution=1920,1200
       resources: iomemory:620-61f iomemory:400-3ff irq:222 memory:628e000000-628effffff memory:4000000000-400fffffff ioport:4000(size=64) memory:c0000-dffff memory:4010000000-4016ffffff memory:4020000000-40ffffffff
# sudo dnf list installed | grep nvidia
dnf-plugin-nvidia.noarch                         2.1-2.el9                           @cuda-rhel9-x86_64
kmod-nvidia-latest-dkms.x86_64                   3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-detect.x86_64                             550.90.07-1.el9.elrepo              @elrepo           
nvidia-driver.x86_64                             3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-driver-NVML.x86_64                        3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-driver-NvFBCOpenGL.x86_64                 3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-driver-cuda.x86_64                        3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-driver-cuda-libs.x86_64                   3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-driver-devel.x86_64                       3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-driver-libs.x86_64                        3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-kmod-common.noarch                        3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-libXNVCtrl.x86_64                         3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-libXNVCtrl-devel.x86_64                   3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-modprobe.x86_64                           3:555.42.02-2.el9                   @cuda-rhel9-x86_64
nvidia-persistenced.x86_64                       3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-settings.x86_64                           3:555.42.02-1.el9                   @cuda-rhel9-x86_64
nvidia-xconfig.x86_64                            3:555.42.02-2.el9                   @cuda-rhel9-x86_64

#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.

I got it to work! Following this post solved it: How to Install NVIDIA Driver and CUDA on Rocky 9.1 - #11 by timppu