To help people having the same problem, here are the steps I did following @generix’s pointers.
My laptop has an AMD Ryzen 4800H (with an iGPU) with NVIDIA RTX2060 dGPU. I installed Xubuntu 18.04.4. Initially, I could not get to the login window, after installing the nvidia-driver-440, select nvidia from prime-select, and backlist the nouveau kernel module, I was able to login but I can only see 1 (connect to DP) out of the 3 screens.
Here are the steps to fixes (I am retracing my steps, but if any of these are unneeded, let me know)
- according to @generix, Ubuntu 20.04 may work better but I managed to get 18.04 to work, so either will apply
- after a fresh installation and reboot, system won’t show the login window, press
ctrl+alt+F2 to get a tty terminal, login with your account, and run
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-driver-440
- blacklist nouveau module by typing
sudo nano /etc/modprobe.d/disable-nouveau.conf and add
alias nouveau off
alias lbm-nouveau off
options nouveau modeset=0
- now if you do a reboot, you should be able to see the log-in window (only 1 display is on), but the below steps can still be completed in a terminal window in case graphics is still not working.
- go to this post by @generix (GeForce GTX 1650 Ti and Linux Mint 19.3), and download the kernel 5.6 linux kernel deb files, and install them by
sudo dpkg -i linux-*.deb
- not sure it is needed, but I did a reboot, and then reinstalled nvidia driver by
sudo apt-get install --reinstall nvidia-driver-440
sudo prime-select nvidia
in the command line to set nvidia as the primary gpu
sudo nano /usr/share/X11/xorg.conf.d/10-amdgpu.conf, replacing
Driver "amdgpu" by
sudo nano /usr/share/X11/xorg.conf.d/10-nvidia.conf, insert
Option "PrimaryGPU" "Yes"
OutputClass section (the only section).
optimus.desktop file by
sudo nano /etc/xdg/autostart/optimus.desktop
and insert the below content
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
optimus.desktop to /usr/share/gdm/greeter/autostart/ by
sudo cp /etc/xdg/autostart/optimus.desktop /usr/share/gdm/greeter/autostart/
- see @generix’s post above, go to https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/amdgpu and download all .bin files starting with “renoir”, and then in the terminal,
sudo cp -a renoir*.bin /lib/firmware/amdgpu
sudo update-initramfs -u to add the new renoir module
- now do a reboot, you should now see all screens,
xrandr -q should also list all screens
nvidia-smi should show the gpu info
glmark2 should print the nvidia opengl driver is in use
if I miss any steps, or the orders of these are misplaced, please feel free to let me know and I can edit.