Ryzen 7 + GTX 1660Ti: blank screen on external outputs in Hybrid graphics mode

Hi Friend,

Indeed, if the with screen at maximun brightness losse all the posibles beneficts of the non-nvidia save power, even drain more than nvidia with mid brightness level. And the fact of the maximum brightness hurts severely the eyes, actually there is no deal use this hybrid mode right now. If some one fix it, will be a deal breaker.

Regards!

Did you guys run any battery tests in hybrid mode on Windows?

Like I said I get around 4 hours of battery in Linux, and in Windows I got at most 1 hour more, and this was not doing anything, just letting the computer sit there. Using the computer I got maybe 30 minutes more… so totally not worth it using Hybrid even in Windows.

I think it was finally fixed in 5.10, I do get an HDMI signal with that kernel version but that’s when only having the Nvidia GPU set (non-hybrid mode). I tried to make the HDMI output work with hybrid graphics but I’m getting a bit stuck. When I connect the HDMI monitor KDE detects it but does not activate it (activating it manually doesn’t change anything, the setting is reverted as soon as I open the system settings again) and changing the external display modes don’t do anything.

This seems weird since I configured Xorg as the Nvidia docs detail:

Section "ServerLayout"
  Identifier     "X.org Configured"
  Screen      0  "AMD"
  Inactive "nvidia"
  Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
     Identifier "AMD"
     Driver "amdgpu"
     BusID  "PCI:05:0:0"
     Option "DRI" "3"
     Option "TearFree" "true"
EndSection

Section "Screen"
    Identifier "AMD"
    Device "AMD"
EndSection

Section "Device"
    Identifier  "nvidia"
    Driver      "nvidia"
    Option "AllowEmptyInitialConfiguration"
    BusID       "PCI:01:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

Section "ServerFlags"
    Option "IgnoreABI" "1"
EndSection

I also tried the next commands once the HDMI monitor is plugged in:

xrandr --setprovideroutputsource 1 0
xrandr --auto

The screen flashes rapidly and the next error is given:

xrandr: Configure crtc 4 failed

But at least I can finally use an external monitor with just the Nvidia GPU (and some quick-switch scripts I made) thanks to the kernel fix!

Hi Jorgetech!,

Can you prepare a tutorial please here, reddit or the plase you want to guide another friends with lenovo legion 5 + linux.
The brightness works for you in integrated, hibryd or nvidia modes?

Regards!

1 Like

If you mean being able to adjust the brightness or the brightness being restored to the previous value, then I do have that working in hybrid and nvidia-only modes, do note that I’m using an Asus TUF FX505DT laptop though (Ryzen 5 3550H + Nvidia GTX), so I have no idea what’s the status of brightness control on recent Legion laptops (I had to install an additional kernel module for having the keyboard lights work in the Asus).

Even though I don’t know about the brightness thing (maybe @carlosmorales777 knows about that), there could be some things in common with this recent Ryzen + Nvidia laptops, so I’m going to give more detail on how I had everything working with Ubuntu 20.10.

First of all, I recommend using at least kernel 5.8 since I was having some problems with the kernel Ubuntu 20.04 LTS was using (sometimes the laptop would freeze on boot, but that may be an Asus TUF specific thing, fixed in newer kernels) and it’s better anyways if you are using recent Ryzen CPUs, for the moment I decided to settle on 5.10.0 since the brightness was a bit weird with Ubuntu’s 5.8 (brightness was not set to previous value on reboot).

After performing a normal installation of (K)Ubuntu 20.10 I first installed the 5.10.0 kernel using the very useful software for installing newer kernels in Ubuntu called Mainline. Then I installed the Nvidia drivers (460 series) from the proprietary graphics drivers PPA. After rebooting the driver will be installed correctly but I wasn’t able to use hybrid mode since for some reason the GPUs are not fully detected, this can be easily fixed with a custom Xorg configuration that specifies the PCI BusIDs assigned to each GPU, you can check that with the lspci command or something like KDE’s Info Center or Hardinfo, the format is “PCI:X:X:X” and it may vary depending on the laptop you have, in my case the Xorg configuration to make Hybrid graphics work was as follows (placed in “/usr/share/X11/xorg.conf.d” in case of Ubuntu, “/etc/X11/xorg.conf.d” may also work):

Section "ServerLayout"
  Identifier     "X.org Configured"
  Screen      0  "AMD"
  Inactive "nvidia"
  Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
     Identifier "AMD"
     Driver "amdgpu"
     BusID  "PCI:05:0:0"
     Option "DRI" "3"
     Option "TearFree" "true"
EndSection

Section "Screen"
    Identifier "AMD"
    Device "AMD"
EndSection

Section "Device"
    Identifier  "nvidia"
    Driver      "nvidia"
    Option "AllowEmptyInitialConfiguration"
    BusID       "PCI:01:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

Section "ServerFlags"
    Option "IgnoreABI" "1"
EndSection

Of course, as I already mentioned, I cannot get external HDMI displays working with this mode even though they should, but they do work if you use an Xorg configuration that sets up the Nvidia GPU as the primary display:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "AMD"
EndSection

Section "Device"
    Identifier  "nvidia"
    Driver      "nvidia"
    BusID       "PCI:01:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

Section "Device"
    Identifier  "AMD"
    Driver      "amdgpu"
    BusID       "PCI:05:0:0"
    Option "DRI" "3"
    Option "TearFree" "true"
EndSection

Section "Screen"
    Identifier "AMD"
    Device "amdgpu"
EndSection

But changing manually between the two is too cumbersome, for solving that I created two custom scripts that I linked to the desktop (keep in mind they require superuser access to work, I used KDE’s kdesu in the desktop shortcut, you could use pkexec in GNOME since gksu was brilliantly removed with GNOME 3).

This script for using Hybrid mode:

#!/bin/bash

sudo mv /usr/share/X11/xorg.conf.d/09-optimus-nvidia.conf /usr/share/X11/xorg.conf.d/09-optimus-nvidia.conf.bak
sudo mv /usr/share/X11/xorg.conf.d/09-optimus-hybrid.conf.bak /usr/share/X11/xorg.conf.d/09-optimus-hybrid.conf

And this one for using only the Nvidia GPU (HDMI working):

#!/bin/bash

sudo mv /usr/share/X11/xorg.conf.d/09-optimus-hybrid.conf /usr/share/X11/xorg.conf.d/09-optimus-hybrid.conf.bak
sudo mv /usr/share/X11/xorg.conf.d/09-optimus-nvidia.conf.bak /usr/share/X11/xorg.conf.d/09-optimus-nvidia.conf

After executing those scripts you reboot and you are done.