Laptop with ryzen/vega + nvidia can't use second screen

Hi,
I've recently got new laptop and installed Manjaro on it, but I ran into issue where I can't use dual-screen setup with external monitor.
I'm using Nvidia driver for dedicated GPU and right after install I could use only external monitor. After deletingrenaming automatically generated configuration/etc/X11/xorg.conf.dI can use built-in screen but external monitor is not detected.
To my knowledge hdmi port is wired to ndivia chip.

inxi -Fxxxz output:

System:    Host: FanciestLinux Kernel: 5.6.0-2-MANJARO x86_64 bits: 64 compiler: gcc v: 9.2.1 Desktop: KDE Plasma 5.17.5 
           tk: Qt 5.14.1 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Laptop System: ASUSTeK product: TUF Gaming FX505DV_TUF505DV v: 1.0 serial: <filter> 
           Mobo: ASUSTeK model: FX505DV v: 1.0 serial: <filter> UEFI: American Megatrends v: FX505DV.303 date: 09/19/2019 
Battery:   ID-1: BAT0 charge: 45.1 Wh condition: 45.1/48.2 Wh (94%) volts: 12.9/11.9 model: FX50442 type: Li-ion 
           serial: <filter> status: Full 
CPU:       Topology: Quad Core model: AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx bits: 64 type: MT MCP arch: Zen+ rev: 1 
           L2 cache: 2048 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 33548 
           Speed: 1231 MHz min/max: 1400/2100 MHz boost: enabled Core speeds (MHz): 1: 1231 2: 1230 3: 1607 4: 1315 5: 2768 
           6: 2770 7: 1231 8: 1230 
Graphics:  Device-1: NVIDIA TU106M [GeForce RTX 2060 Mobile] vendor: ASUSTeK driver: nvidia v: 440.59 bus ID: 01:00.0 
           chip ID: 10de:1f11 
           Device-2: Advanced Micro Devices [AMD/ATI] Picasso vendor: ASUSTeK driver: amdgpu v: kernel bus ID: 05:00.0 
           chip ID: 1002:15d8 
           Display: x11 server: X.Org 1.20.7 driver: amdgpu,nvidia FAILED: ati unloaded: modesetting,nouveau 
           alternate: fbdev,nv,vesa compositor: kwin_x11 resolution: 1920x1080~120Hz 
           OpenGL: renderer: AMD RAVEN (DRM 3.36.0 5.6.0-2-MANJARO LLVM 9.0.1) v: 4.5 Mesa 19.3.4 direct render: Yes 
Audio:     Device-1: NVIDIA TU106 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus ID: 01:00.1 
           chip ID: 10de:10f9 
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel 
           bus ID: 05:00.6 chip ID: 1022:15e3 
           Sound Server: ALSA v: k5.6.0-2-MANJARO 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK driver: r8169 v: kernel port: e000 
           bus ID: 02:00.0 chip ID: 10ec:8168 
           IF: enp2s0 state: down mac: <filter> 
           Device-2: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter vendor: AzureWave driver: rtw_pci v: N/A 
           port: d000 bus ID: 04:00.0 chip ID: 10ec:c822 
           IF: wlp4s0 state: up mac: <filter> 
Drives:    Local Storage: total: 942.70 GiB used: 9.23 GiB (1.0%) 
           ID-1: /dev/nvme0n1 vendor: Intel model: SSDPEKNW512G8 size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> 
           rev: 002C scheme: GPT 
           ID-2: /dev/sda vendor: Seagate model: ST500LT012-1DG142 size: 465.76 GiB speed: 6.0 Gb/s rotation: 5400 rpm 
           serial: <filter> rev: SDM1 scheme: GPT 
Partition: ID-1: / size: 58.81 GiB used: 9.20 GiB (15.6%) fs: ext4 dev: /dev/nvme0n1p5 
Sensors:   System Temperatures: cpu: 48.6 C mobo: N/A gpu: amdgpu temp: 49 C 
           Fan Speeds (RPM): cpu: 2400 
Info:      Processes: 225 Uptime: 12m Memory: 15.14 GiB used: 1.45 GiB (9.6%) Init: systemd v: 242 Compilers: gcc: 9.2.1 
           Shell: bash v: 5.0.16 running in: yakuake inxi: 3.0.37 

:+1: Welcome to Manjaro! :+1:

What's the output of

xrandr --query
mhwd --listinstalled

And does your system have a hardware key to switch monitors? (on my system it's Fn+F5)

My keyboard does have hardware key for switching monitors (Fn + F9), when I press it I get the option to mirror/extend to second display but nothing happens.

xrandr --query
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080    120.00*+  48.00  
   1680x1050    120.00  
   1280x1024    120.00  
   1440x900     120.00  
   1280x800     120.00  
   1280x720     120.00  
   1024x768     120.00  
   800x600      120.00  
   640x480      120.00  

mhwd --listinstalled
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
    video-nvidia-440xx            2019.10.25               false            PCI
           video-linux            2018.05.04                true            PCI


Warning: No installed USB configs!

I also want to point out again that the second screen was working with this configuration (which I have disabled, as mentioned in the post):

cat /etc/X11/xorg.conf.d_bkp/90-mhwd.conf 
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 440.59

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

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

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
        Option "NoLogo" "1"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection

 
Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

You've renamed the entire directory! You should only rename individual fines in there as you cannot make any changes any more and are stuck with what you have.

Can you remediate that and also try another HDMI cable?

Renaming back that directory changed nothing, I still don't see the second screen in settings.
Using different HDMI cable also did nothing, but that's expected since it works perfectly in windows and with nvidia config file.

So you've renamed 90-mhwd.conf and /etc/X11/xorg.conf.d exists.

If yes,

  1. connect the monitor and execute:

    mhwd --auto PCI nonfree 0300
    
  2. Reboot (or restart X)

  3. Log on,

  4. Go to System Settings Display Configuration

  5. If the monitor is still not present, please provide another xrandr --query

If no, please remediate first.

I've done what you suggested and nothing changed.

vharabari@FanciestLinux ~ % mhwd --auto pci nonfree 0300
> Skipping already installed config 'video-nvidia-440xx' for device: 0000:01:00.0 (0300:10de:1f11) Display controller
nVidia Corporation TU106M [GeForce RTX 2060 Mobile]
> Skipping already installed config 'video-linux' for device: 0000:05:00.0 (0300:1002:15d8) Display controller ATI Te
chnologies Inc Picasso

Edit:

xrandr --query
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080    120.00*+  48.00  
   1680x1050    120.00  
   1280x1024    120.00  
   1440x900     120.00  
   1280x800     120.00  
   1280x720     120.00  
   1024x768     120.00  
   800x600      120.00  
   640x480      120.00

Did a new /etc/X11/xorg.conf.d/90-mhwd.conf get created?

No, it was not.

@dglt Some advice about the above? Go to TTY2, delete all drivers and re-install??? Or is there another way of re-generatong an mhwd.conf?

when mhwd installs whichever driver package it creates various applicable .conf files if needed. for nvidia it usually creates a /etc/X11/mhwd.d/nvidia.conf which is then symlinked as /etc/X11/xorg.conf.d/90-mhwd.conf. but thats not the reason the external display wont work.

your actually only using your AMD, the nvidia is just sitting there getting fat off battery cocktail.

as it should be IMO and usually is but not always. if your setup is using a render-offload prime which from your outputs looks like your are and your video outputs are wired to the nvidia then you can forget about having external displays(when using render-offload). render-offload may support power management for your turing gpu but it also does this at the cost of turning your external video ports into nothing more than ventilation.

anyway, with your current setup the way it is and the external display plugged in/turned on, post these outputs

xrandr --prop
xrandr --listproviders
glxinfo | grep -i vendor
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep -i vendor
1 Like

I'm posting the output twice for nvidia config enabled (90-mhwd.conf) and disabled:

Enabled(output to external only, tty2 visible on primary):

❯ xrandr --prop
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 521mm x 293mm
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        EDID: 
                00ffffffffffff004c2d2c0d46415a42
                201d010380341d782a5295a556549d25
                0e5054bb8c00b30081c0810081809500
                a9c001010101023a801871382d40582c
                450009252100001e000000fd0032481e
                5216000a202020202020000000fc0043
                3234463339300a2020202020000000ff
                0048345a4d3830343831390a20200151
                020324f14690041f1312032309070783
                01000067030c001000802b681a000001
                013a4800011d00bc52d01e20b8285540
                09252100001e8c0ad090204031200c40
                55000925210000188c0ad08a20e02d10
                103e9600092521000018215280a07238
                304088c8350009252100001c00000000
                000000000000000000000000000000f0
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: HDMI 
        ConnectorNumber: 0 
        _ConnectorLocation: 0 
        non-desktop: 0 
                supported: 0, 1
   1920x1080     60.00 +  71.91*   59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1440x900      59.89  
   1280x1024     60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1024x768      70.07    60.00  
   800x600       72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       72.81    59.94
 xrandr --listproviders  
Providers: number : 1
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 1 associated providers: 0 name:NVIDIA-0
glxinfo | grep -i vendor
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep -i vendor
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation

Disabled (output to primary only):

❯ xrandr --prop
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
        EDID: 
                00ffffffffffff003870360000000000
                011c010495221378036850985c588e28
                1b505400000001010101010101010101
                0101010101010a8380a0703808413020
                350058c21000001a0a8380a07038e848
                3020350058c21000001a000000fd0030
                78a2a222010a202020202020000000fe
                004c4d3135364c462d474c20200a00de
        GAMMA_LUT_SIZE: 4096 
                range: (0, -1)
        DEGAMMA_LUT_SIZE: 4096 
                range: (0, -1)
        GAMMA_LUT: 0 
                range: (0, 65535)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        DEGAMMA_LUT: 0 
                range: (0, 65535)
        TearFree: auto 
                supported: off, on, auto
        HDCP Content Type: HDCP Type0 
                supported: HDCP Type0, HDCP Type1
        Content Protection: Undesired 
                supported: Undesired, Desired, Enabled
        vrr_capable: 1 
                range: (0, 1)
        abm level: 0 
                range: (0, 4)
        max bpc: 16 
                range: (8, 16)
        underscan vborder: 0 
                range: (0, 128)
        underscan hborder: 0 
                range: (0, 128)
        underscan: off 
                supported: off, on, auto
        scaling mode: None 
                supported: None, Full, Center, Full aspect
        link-status: Good 
                supported: Good, Bad
        CONNECTOR_ID: 64 
                supported: 64
        non-desktop: 0 
                range: (0, 1)
   1920x1080    120.00*+  48.00  
   1680x1050    120.00  
   1280x1024    120.00  
   1440x900     120.00  
   1280x800     120.00  
   1280x720     120.00  
   1024x768     120.00  
   800x600      120.00  
   640x480      120.00  

❯ 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: 0x1f7 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0

lxinfo | grep -i vendor
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
    Vendor: X.Org (0x1002)
OpenGL vendor string: X.Org

❯ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep -i vendor
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation

Also to note, in Nvidia X Server Settings external display is visible with both configs

by this you mean disabling the integrated graphics from bios or just by xorg configuration?

the output of this confirmed what i suspected that your configuration is render-offload prime, those parameters tell xorg to use the nvidia gpu, without those parameters everything runs on the AMD igpu.

if you want external display capability you'll have to use the "real" PRIME, the one thats not crippled by nvidias recently introduced render-offload prime. confused?, the geniuses at nvidia apparently thought it was a good idea calling 2 completely different setups by the same name :man_facepalming:

i made a modified version of optimus-switch for @Swagglepuf that works with amd/nvidia laptops but it's made for LightDM and not SDDM like you use. i'm looking it over right now and i'll post a version that works for SDDM in a few

ok, i created a separate repo for optimus-switch that should work with SDDM. to set it up follow these instructions carefully

  • this setup assumes you still already have both video-linux and video-nvidia-440xx installed, your mhwd -li output from earlier says you do.

  • this setup assumes your using the 5.6 kernel as shown in your inxi output. if you have other kernels installed (check with mhwd-kernel -li) then make sure to add it to the pacman command below so each installed kernel has the matching kernel headers installed. if you have 5.4 and 5.6 installed you would make sure linux56-headers and linux54-headersare installed.

  • get rid of any custom video related .conf files from these directories. if you didnt create any you can skip this part but i would still double check just in case.

/etc/X11/xorg.conf.d/
/etc/modprobe.d/
/etc/modules-load.d/
  • install optimu-switch. run these exact commands one at a time, if any command fails then stop and post it here
cd ~
sudo pacman -S linux56-headers dkms acpi_call-dkms git xorg-xrandr
git clone https://github.com/dglt1/optimus-switch-amd-sddm.git
cd ~/optimus-switch-amd-sddm
chmod +x install.sh
sudo ./install.sh

if all that goes well, after a reboot you should be using PRIME mode and you should have all your external video ports working and the nvidia gpu is the primary. let me know how it goes

1 Like

Your solution worked for me. Thanks a lot.

2 Likes

so you know, you can switch between amd only mode and amd/nvidia mode but you wont have external display functionality in amd only mode.

to change to amd only mode run this and reboot after.
sudo set-amd.sh

to change to amd/nvidia prime mode, run this and reboot after.
sudo set-nvidia.sh

you only need to run those when you want to change modes, whatever you have set now will persist until you change it.

This just shows @dglt is much smarter than me! :wink: :innocent:

not smarter, it just shows i've already smashed my head into the wall that is optimus graphics many many times since using linux. optimus is intel/nvidia but with amd/nvidia it's just a new dog with the same tricks :man_shrugging:

1 Like

Thank you very much @dglt, I have the same notebook, and I was trying to install Ubuntu, I did it work 1 time both screens, but after reboot, nothing works again, now, I have 1 question, my notebook screen is flickering and need deactivate and activate it again

:+1: Welcome to Manjaro! :+1:

It is unclear from your description wether you're running Ubuntu or Manjaro, but this thread has been solved already so if you would have a new issue on Manjaro it's better to ask a brand new question in our Newbie corner if you're new to Manjaro or the Technical Issues and Assistance category if you're a well-seasoned Linux user migrating away from Ubuntu.

:innocent:

Forum kindly sponsored by