Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sharing - AMDgpu and Nvidia Hybrid
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message

Joined: 19 Feb 2012
Posts: 390
Location: Paris

PostPosted: Sun Aug 02, 2020 4:49 am    Post subject: Sharing - AMDgpu and Nvidia Hybrid Reply with quote

Hi, guys

I just bought a new laptop with AMD 4600H with NVIDIA GTX 1650. Gentoo is newly installed with KDE plasma5 and SDDM. Until now, I can run the system and application with amdgpu without any problem and run specific application with Nvidia property driver. The Nvidia/Optimus support hybrid of AMDgpu and Nvidia I don't know since when. Make sure the laptop boot up with option switchable graphic or hybrid option in BIOS, enable GPU swithing support in Kernel. Here below is what I did. Hope it can help people who have the same hardware

I use the Nvidia property driver, No try for nouveau. Use blacklist method in /etc/modprobe.d/blacklist.conf to block the nvidia modules by udev. Otherwise there is some error with udev to load nvidia property driver. Probably stuck in booting and shutdown during the udev to load/remove nvidia modules. Sometimes you may see message from dmesg like "udev timeout ' add". Looks like it's a bug and not fixed yet. You can search related discussion in the gentoo forum.

running nvidia-xconfig may not generate the xorg.conf configuration correctly. Need manually adjust it. see blow my configuration.
I use sddm as display manager. see page of Gentoo wiki Nvidia/Optimus
Nvidia modules need to be fully loaded before SDDM. Since it's blocked in udev, need to add a sh file in /etc/profile.d/
after all done, run xrandr --listproviders and you will see the message below

xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x54 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 1 associated providers: 0 name:Unknown AMD Radeon GPU @ pci:0000:05:00.0
Provider 1: id: 0x1f6 cap: 0x2, Sink Output crtcs: 4 outputs: 4 associated providers: 0 name:NVIDIA-G0

Refer to the Nvidia instruction Chapter 33 and Chapter 34 and know how to run application with nvidia driver.
less /usr/share/doc/nvidia-drivers-450.57/README.bz2


blacklist nvidia
blacklist nvidia_drm
blacklist nvidia_modeset

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 450.57

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "AMDgpu" 0 0
    Inactive       "nvidia"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "AllowNVIDIAGPUScreens"

Section "Files"

Section "InputDevice"

    # generated from data in "/etc/conf.d/gpm"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"

Section "Device"
    Identifier     "AMDgpu"
    Driver         "amdgpu"
    VendorName     "AMD"
    BusID          "PCI:5:0:0"

Section "Device"
    Identifier     "nvidia"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"

Section "Screen"
    Identifier     "AMDgpu"
    Device         "AMDgpu"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24


xrandr --setprovideroutputsource 1 0
xrandr --auto

modprobe nvidia
modprobe nvidia-drm
modprobe nvidia-uvm
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum