nvidia-xconfig doesnt do what i want it to, nor does nvidia-settings

Maybe some more practical infos:
You have a hybrid amd/nvidia system so you can’t/mustn’t use nvidia-xconfig, you’ll never get a working config out of it. In general, nvidia-xconfig shouldn’t be used on modern systems.

The problem with Ubuntu’s prime-select feature is it (still) doesn’t work for amd/nvidia but only for intel/nvidia. Needs manual tweaking of the config files.

You could try this:
Please delete /etc/X11/xorg.conf
and modify /usr/share/X11/xorg.conf.d/10-amdgpu.conf
replacing only

Driver "amdgpu"

with

Driver "modesetting"

Please add

Option "PrimaryGPU" "Yes"

inside the OutputClass of /usr/share/X11/xorg.conf.d/10-nvidia.conf
Then create two files optimus.desktop in /etc/xdg/autostart/ and /usr/share/gdm/greeter/autostart/ containing

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

This should enable the nvidia profile on Ubuntu.

The “render offload” feature needs a patched Xserver, I don’t know if Ubuntu is providing this. If so, it could be enabled by not doing any of the above mentioned settings, but by creating an /etc/X11/xorg.conf just containing

Section "ServerLayout"
  Identifier "layout"
  Option "AllowNVIDIAGPUScreens"
EndSection

Afterwards, function can be checked running

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor

should return something “Nvidia”.
Then applications can be started on the nvidia gpu running
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia
Downside of this is that no external monitors connected to the nvidia gpu will work.

8 Likes
Enabling switchable graphics on AMD and Nvidia Hybrid GPU in Asus Tuf series Laptops on Linux
Ubuntu 19.04 doesn't detect my HDMI display
GeForce GTX 1050 problem with driver
3D acceleration not working on Ubuntu (AMD Raven / Nvidia GTX 1050 mobile)
Ubuntu 19.04 Driver Installed but not Used
Geforce GTX 1650 HDMI Issue with Ubuntu 18.04
Asus Zephyrus use llvmpipe on ubuntu 20.04 please help
NVIDIA GTX 1650 - Lenovo IdeaPad 3 - Ryzen 4600H - Ubuntu 18.04 - Hdmi Screen not detected
Ubuntu 18.04 - Second monitor couldn't be detected. Using Nvidia-430 form ppa:
Main laptop screen black
Ubuntu 18.04 - Secondary Monitor not detected
Asus tuf fx505dt - amd ryzen 5 - GeForce GTX1650 Mobile - Ubuntu 16.04
GPU not in use in Ubuntu 18.04.5 LTS
Hello, *nvidia-settings* yields this CRITICAL error message
NVIDIA driver is not loaded. Ubuntu 18.10
Xubuntu 20.04 cannot switch back to nvidia graphics
System not using Ubuntu 18 Nvidia Graphics card despite driver being installed
Lenovo IdeaPad 3 Ubuntu 18.04, GTX1650 Ti not running, only llvmpipe
ASUS TUF A15 GTX 1660 ti on Ubuntu 18.04 fresh install, black screen when booting + unknown display device
System not using Nvidia Graphics card despite driver being installed
Secondary Display monitor is not detected by Nvidia drivers
Couldn't detect external monitor in ubuntu 18.04.5 with NVIDIA driver 455.38
Ubuntu 18.04.5 hdmi external monitor problem. nvidia-driver-455.45.01
Ubuntu 18.04 has 2 graphic Radeon and Nvidia RTX 2060 still uses llvmpipe
Ubuntu, GTX 1650, problem with second monitor
Couldn't detect external monitor in ubuntu 18.04.5 with NVIDIA driver 455.38
Couldn't detect external monitor in ubuntu 18.04.5 with NVIDIA driver 455.38
No HDMI output
Couldn't detect external monitor in ubuntu 18.04.5 with NVIDIA driver 455.38
Ubuntu 18.04 still uses llvmpipe driver#3
Auxiliary monitor not detected Ubuntu 20.04, driver 440
Driver installed but not used: Kubuntu 20.04 LTS with GeForce RTX 2060 and Driver 455 (probable AMD conflict)
HP Omen 15 [Ryzen 4600h + Nvidia 1660Ti] - no display over HDMI
Error occurred during installation of Isaac
Remote Display not loading with GeForce GT 710
Nvidia Rtx 3060 is not getting used, AMD default card is accessed
NVIDIA driver is not loaded. Ubuntu 18.10
Nvidia driver does not load on Ubuntu 21.04 with Geforce RTX 3060
Installed driver is not loading returning the message - ERROR: NVIDIA driver is not loaded
Llvmpipe graphics, not able to use nvidia gtx 1650 gpu. Many errors while trying fix
Driver for Nvidia RTX3050 installed but Ubuntu 18.04 doesn't use it as graphic card
Laptop display issues on Debian 11
Ubuntu 18 and nvidia-460 driver not working
Xorg Ryzen with bundled AMD + Nvidia RTX 2060 (mobile) HDMI interface not detected
Nvidia-settings: error, unable to load info from any available system (GTX 1660ti, Ubuntu 20.04, kernel
GeForce GTX 1650 Ti and Linux Mint 19.3
GeForce GTX 1650 Ti and Linux Mint 19.3
Driver installed but won't load: Ubuntu 20.04 NVIDIA TU104GL [Quadro RTX 4000]
GeForce GTX 1650 Ti and Linux Mint 19.3
NVIDIA driver 440.59 doesnt work/HDMI not appearing/NVIDIA X Server Settings opens a blank square + Ubuntu 19.10
Black screen after install of nvidia driver ubuntu
Llvmpipe instead of nvidia GTX 1650
Driver for Nvidia RTX3050 installed but Ubuntu 18.04 doesn't use it as graphic card
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
Laptop unable to display on external monitors on Ubuntu 20.04
Ubuntu 19.04 Driver Installed but not Used
Xubuntu 20.04 cannot switch back to nvidia graphics