Skip to content

Instantly share code, notes, and snippets.

@ony
Created August 25, 2020 22:58
Show Gist options
  • Save ony/e35b492e89b01dfad44bb618f7465f8a to your computer and use it in GitHub Desktop.
Save ony/e35b492e89b01dfad44bb618f7465f8a to your computer and use it in GitHub Desktop.
Using nVidia as an overpriced output adapter for AMD

Original problem

  • Monitor with only DVI free port that supports native resolution.
  • Tired from nVidia tension with Linux and switching to AMD.
  • New AMD cards and built-in have no DVI output and adapter will arrive late.

Solution: use reverse prime with nouveau

It is well described in https://wiki.archlinux.org/index.php/PRIME#Reverse_PRIME But in this case I want to use AMD as a primary and nVidia as a "Source Output" which nouveau supports.

Section "ServerLayout"
  Identifier     "layout"
  Screen      0  "primary-screen" # Screen for your primary GPU
  Inactive       "dGPU-nouveau"       # Device for your second GPU
EndSection

Section "Screen"
    Identifier "primary-screen"
    Device "dGPU-amd"
    Option "AllowEmptyInitialConfiguration" "true"
EndSection

(there were no need to specify PCIs for me)

Since AMD is not connected to any outputs need to wire them every time. E.g. https://wiki.archlinux.org/index.php/NVIDIA_Optimus#LightDM

But in my case I had terrible performance if xrandr doesn't have any mode enabled for AMD. Thus I had to modify start-up:

# Use outputs from nVidia (nouveau) for primary GPU
if xrandr --setprovideroutputsource nouveau 0 && xrandr --auto; then
  # force native resolution even that it cannot be shown through HDMI input of display
  # effectively turns off display, but still renders/clons through nouveau to DVI
  xrandr --addmode HDMI-A-1 2560x1440 && xrandr --output HDMI-A-1 --mode 2560x1440 || true
fi

In my case HDMI was the only port I was able to use for monitor, but it limited to 1920x1080. Thus this effectively turns of display over HDMI. It looks like this also fixed glitch when I saw only cursor for login window and had to switch back and forth on monitor beetween HDMI and DVI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment