Question about dual-monitor nvidia management

Hi!
I’m using XFCE EndeavourOS on my HP Omen 2020, it is a laptop with AMD integrated and Nvidia dedicated GPU. I’m running it in a dual monitor setup, with the second monitor connected through HDMI.

Endeavour with Nvidia drivers preinstalled runs with no problems and it works out of the box. Never had a single trouble.
I tried to install several distros on this machine, but every distro I tried (Debian, MXLinux, Void, Mint, Archlabs…and more) that doesn’t ship with Nvidia drivers preinstalled has the same problem: it doesn’t detect my second monitor out of the box. Now, I get that I have to install the drivers in order to get it work, and this isn’t a problem usually. The thing that I can’t understand is that after the installation of the drivers and reboot, the second monitor still can’t be detected.
I can (sometimes) see it only after a lot of tinkering, usually with xorg.conf. After setting the config the right way, usually it starts working (although with some little troubles here and there).

So I thought that it must be somewhere a sort of Xorg config file on EndeavourOS too, and I was going to check it in order to discover what am I missing and the way it should be to have it working.

The thing is that I can’t find any config file similar to that. In fact, I can’t find any configuration file about the displays at all, it just ran perfectly since the first start, like magically.
So, since neither of the other distros can do that, al least not out of the box, I’m trying to understand what Endeavour is “doing” differently. Has it something to do with the way the Nvidia drivers are (pre)configured? Where can I find the file that handles the display’s layout? It HAS to be something, somewhere, to my (limited) understanding.

Note that every other distro I tried were on XFCE too, so the thing has nothing to do with the DE, and it’s Endeavour-related (the same thing used to happen in KDE).

Check if it has this file.

/etc/X11/xorg.conf.d/20-nvidia.conf 

I already checked. I don’t know how, but I haven’t it.
This is exactly what pushed me to ask the question :grin:

You have amd gpu and Nvidia. You say Nvidia drivers are installed. The external monitor is not working? How are you switching graphics?

What does this show?

inxi -Ga

Yes, Nvidia drivers are preinstalled. The external monitor is working perfectly. I am not switching graphics, as I said it’s working out of the box and I’m not doing anything.
Searching on the web I found lspci -vnnn | perl -lne 'print if /^\d+\:.+(\[\S+\:\S+\])/' | grep VGA which should show which GPU I’m using and it says I’m using both.

What does this show?
inxi -Ga

It shows this:

Graphics:
  Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile]
    vendor: Hewlett-Packard driver: nvidia v: 515.57
    alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-06) arch: Turing process: TSMC 12nm
    built: 2018-22 pcie: gen: 2 speed: 5 GT/s lanes: 8 link-max: gen: 3
    speed: 8 GT/s lanes: 16 ports: active: none off: HDMI-A-1
    empty: DP-1,DP-2 bus-ID: 01:00.0 chip-ID: 10de:2191 class-ID: 0300
  Device-2: AMD Renoir vendor: Hewlett-Packard driver: amdgpu v: kernel
    arch: GCN 5.1 process: TSMC n7 (7nm) built: 2018-21 pcie: gen: 3
    speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s ports:
    active: eDP-1 empty: none bus-ID: 07:00.0 chip-ID: 1002:1636
    class-ID: 0300
  Device-3: Cheng Uei Precision Industry (Foxlink) HP Wide Vision HD Camera
    type: USB driver: uvcvideo bus-ID: 3-3:2 chip-ID: 05c8:03df class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.3 compositor: xfwm v: 4.16.1 driver:
    X: loaded: amdgpu,nvidia unloaded: modesetting
    alternate: fbdev,nouveau,nv,vesa gpu: amdgpu,nvidia,nvidia-nvswitch
    display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 2560x2520 s-dpi: 96 s-size: 677x667mm (26.65x26.26")
    s-diag: 950mm (37.42")
  Monitor-1: HDMI-A-1 mapped: HDMI-1-0 note: disabled pos: primary,top-left
    model: Asus PB278 serial: E1LMTF061566 built: 2014 res: 2560x1440 hz: 60
    dpi: 109 gamma: 1.2 size: 597x336mm (23.5x13.23") diag: 685mm (27")
    ratio: 16:9 modes: max: 2560x1440 min: 640x480
  Monitor-2: eDP-1 mapped: eDP pos: primary,bottom-r
    model: LG Display 0x05fe built: 2018 res: 1920x1080 hz: 144 dpi: 142
    gamma: 1.2 size: 344x194mm (13.54x7.64") diag: 395mm (15.5") ratio: 16:9
    modes: max: 1920x1080 min: 640x480
  OpenGL: renderer: AMD RENOIR (LLVM 14.0.6 DRM 3.46 5.18.10-arch1-1)
    v: 4.6 Mesa 22.1.3 direct render: Yes

It’s running on amdgpu and yes the drivers are installed. How do you switch between graphics? Or do you? Or do you care? If the system is working fine and you have no need to use nvidia graphics for gaming or what ever then it really doesn’t matter. As far as what xorg file is set up on the system you’ll have to check and see. As far as why it a monitor doesn’t work on other distro’s i have no answer.

Yes. The system is working fine and I’m totally happy with it.

As far as what xorg file is set up on the system you’ll have to check and see.

I’m sorry if I wasn’t clear, my question was: how/where can I check, since I haven’t /etc/X11/xorg.conf.d/20-nvidia.conf?
Is there a config file that handles these things, like a file with inxi -G-like data which I can copy and use on other distros in order to setup other distros the same way I set up Endeavour, Nvidia and display-wise?

To my understanding it has to be, somewhere, a file/config like this…if I haven’t 20-nvidia.conf so I should have a similar substitute that does the same thing. Otherwise, how do it work?

There is one explanation, and it is the simplest one, as usual. :wink:
I don’t know about non-arch-based systems, but it should be similar.

You don’t need any configuration file.

Those other distros, might probably try to outsmart the system, using a better AI powered method, and they fail.
Nowadays, Xorg and video drivers with the proper (upstream Archlinux) packaging (installation instructions), handle the majority of system HW/SW configurations.
In the rare cases that there are some issues, a proper configuration file may help. Those files are saved at /etc/X11/xorg.conf.d/ folder.
Another probable reason for others failing, might be that they may use custom, or public utilities OOTB (which feels to a new user like it is not something extra), but the user may not be properly informed about proper usage.
In short, everything needs to be proper! :rofl:

Since you seem to be using only the AMD graphics, does it mean you could remove the Nvidia card from your system? That might be an interesting experiment…

It seems kind of a hard issue for a newbie (as he has posted in this category) :wink:

1 Like

Okay…so there is no way to somehow copy/replicate the behavior of Endeavor on other distros? :sweat_smile:

Well actually I don’t get where it shows that I’m not using the dedicated GPU…plus, if this is true, does that mean that my problem isn’t Nvidia related at all?! :grimacing:

With arch-based distros, you can try.
In any case/distro, I would search their documentation about this feature and/or ask at their support page.

1 Like

Even if at the time of terminal commands/reports are run, nvidia driver/module does not actually do any job, it is still available/loaded:

But the important is that with laptops, the external output connectors are usually attached to the dGPU (nvidia), so it matters with external monitors.
I guess what was meant was that you could uninstall proprietary nvidia and let the kernel-included nouveau to drive nvidia card. If you don’t need much power (for games, or video/graphics applications), nouveau would do the job fine. :person_shrugging:

Would be interesting to see the output of this:

lspci -vnn | grep -PA 15 'VGA|3D|Display' | grep "in use"
1 Like

It would probably be more efficient to ask the support channels for those distros how to configure monitors… ?

2 Likes

i do use Nvidia for video editing, movies conversion, graphics and similar…or at least I thought so :rofl:

at this point the question is: how can I see which GPU are my displays using? and more in general if i’m using both my GPUs and what for? :sweat_smile:

Kernel driver in use: nvidia
Kernel driver in use: amdgpu

so it seems I’m using both, right?

1 Like

sure, i will. i just thought that asking on the forum of the only distro that is working right could helped me to find the magic file and copy it, in order to paste it on other distros :grin:

Sometimes it’s just the hardware and UEFI Bios is better and that makes it work correctly. Someone else won’t be so lucky. Doesn’t mean it’s going to work the same on another Linux version.

Your system is probably set up to use the dedicated Gpu when an external monitor is connected. I guess one could disconnect the external monitor and run the same command and see if it only shows amdgpu? :man_shrugging: