External monitor not working

I just installed Manjaro on my new machine, a Lenovo ThinkPad X1 Exteme (Gen 2) (https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Extreme_(Gen_2)).

Almost everything works, except for the external monitor.

I was able to install the latest NVIDIA drivers. The output of lspci -k | grep -A 2 VGA is

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
        Subsystem: Lenovo UHD Graphics 630 (Mobile)
        Kernel driver in use: i915
--
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)
        Subsystem: Lenovo TU117M [GeForce GTX 1650 Mobile / Max-Q]
        Kernel driver in use: nvidia

Using nvidia-settings, I can see my external monitor is detected in the HDMI-0 port.

On the other hand, xrandr detects only the screen of the laptop

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm

Using glxgears -info I see that the Intel card is used

GL_RENDERER   = Mesa Intel(R) UHD Graphics 630 (CFL GT2)
GL_VERSION    = 4.6 (Compatibility Profile) Mesa 20.0.7
GL_VENDOR     = Intel

do I need to switch to NVIDIA to be able to use my external monitor? How do I do that?

Post full output of xrandr --prop please.
And in the meantime search the forum for optimus-manager and read related how-to posts carefully.
I hope another fellow user will help you to proceed.
Good night.

the full output of xrandr --prop is

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
        EDID: 
                00ffffffffffff0009e5090800000000
                1e1c0104b523137802df50a35435b526
                0f505400000001010101010101010101
                01010101010150d000a0f0703e803020
                350058c21000001aa6a600a0f0703e80
                3020350058c21000001a000000fe0042
                4f452048460a202020202020000000fe
                004e4531353651554d2d4e36360a0192
                02030f00e3058000e606050160602800
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                000000000000000000000000000000aa
        scaling mode: Full aspect 
                supported: Full, Center, Full aspect
        Colorspace: Default 
                supported: Default, RGB_Wide_Gamut_Fixed_Point, RGB_Wide_Gamut_Floating_Point, opRGB, DCI-P3_RGB_D65, BT2020_RGB, BT601_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, BT2020_CYCC, BT2020_YCC
        max bpc: 12 
                range: (6, 12)
        Broadcast RGB: Automatic 
                supported: Automatic, Full, Limited 16:235
        link-status: Good 
                supported: Good, Bad
        CONNECTOR_ID: 95 
                supported: 95
        non-desktop: 0 
                range: (0, 1)
   3840x2160     60.00 +  59.98    59.97    48.00  
   3200x1800     59.96    59.94  
   2880x1620     59.96    59.97  
   2560x1600     59.99    59.97  
   2560x1440     59.99    59.99    59.96    59.95  
   2048x1536     60.00  
   1920x1440     60.00  
   1856x1392     60.01  
   1792x1344     60.01  
   2048x1152     59.99    59.98    59.90    59.91  
   1920x1200     59.88    59.95  
   1920x1080     60.01*   59.97    59.96    59.93  
   1600x1200     60.00  
   1680x1050     59.95    59.88  
   1400x1050     59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     60.02  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1280x800      59.99    59.97    59.81    59.91  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   700x450       59.96    59.88  
   640x480       60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   640x400       59.88    59.98  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32

I installed optimus-manager. When I try running optimus-manager --print-mode I get

ERROR: a GPU setup was initiated but Xorg post-start hook did not run.
Log at /var/log/optimus-manager/switch/switch-20200707T191557.log
If your login manager is GDM, make sure to follow those instructions:
https://github.com/Askannz/optimus-manager#important--gnome-and-gdm-users
If your display manager is neither GDM, SDDM nor LightDM, or if you don't use one, read the wiki:
https://github.com/Askannz/optimus-manager/wiki/FAQ,-common-issues,-troubleshooting

Cannot execute command because of previous errors.

I solved the previous error modifying /etc/sddm.conf as follows

DisplayCommand=/usr/bin/prime-offload
DisplayStopCommand=/usr/bin/prime-switch

but now if I try optimus-manager --switch nvidia I get a blank screen and the only possible way out is a hard reboot

Oops I meant xrandr --listproviders, sorry.

Here you go

Providers: number : 1
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:modesetting

What mhwd -li says? I need to know what kind of Manjaro config is installed right now.
I'd appreciate if you post the output of inxi -Gxxz, too.

Below are side-notes:

You'd better don't modify /etc/sddm.conf in that manner, since optimus-manager has its own config file placed in /etc/sddm.conf.d,

A correct way to grep and display one's video cards is lspci -nnk | grep -E 'VGA|3D'.

the output of mhwd -li is

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-440xx-prime            2019.10.25               false            PCI
           video-linux            2018.05.04                true            PCI


Warning: No installed USB configs!

The output of inxi - Gxxz is

Graphics:  Device-1: Intel UHD Graphics 630 vendor: Lenovo driver: i915 v: kernel bus ID: 00:02.0 
           chip ID: 8086:3e9b 
           Device-2: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: Lenovo driver: N/A bus ID: 01:00.0 
           chip ID: 10de:1f91 
           Display: x11 server: X.Org 1.20.8 driver: modesetting compositor: kwin_x11 resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.0.7 direct render: Yes

what do you recommend to do instead of modifying directly /etc/sddm.conf? If I don't do that, optimus-manager produces the error I described above

Try to switch to hybrid: optimus-manager --switch hybrid. Install nvidia-prime and launch glxgears using it: prime-run glxgears -info. But better to use prime-run glxgears |grep vendor. See the output, if it says Nvidia, then it works. As for another part of the problem (sddm.conf modification), I can't say anything without looking at the log file you were informed about when optimus-manager crash occurred (/var/log/optimus-manager/switch/switch-20200707T191557.log).

PS: also after switching to hybrid (if it is successful) you can run various commands and read their output like:
inxi - Gxxz (it shout say nvidia in the "driver" section)
xrandr --listproviders (it should list more providers, I expect to see "NVIDIA-G0" there)

PPS: run lsmod |grep -E 'nvidia|i915|nouveau|bbswitch|acpi_call' to see what modules are loaded now (in Intel and Hybrid mode). If nouveau is present, nuke it with blacklisting. For your card, the switch method in the optimus-manager settings should be either none or bbswitch.

BTW have you read Arch wiki article and Readme on optimus-manager? Also consider installing optimus-manager-qt for easy application of settings and comfortable switching of modes.

Thanks a lot for your suggestions. Switching to hybrid mode worked and now these are the output of the command you suggested

[marcosh@marcoshoisy ~]$ inxi -Gxxz 
Graphics:  Device-1: Intel UHD Graphics 630 vendor: Lenovo driver: i915 v: kernel bus ID: 00:02.0 
           chip ID: 8086:3e9b 
           Device-2: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: Lenovo driver: nvidia v: 440.82 
           bus ID: 01:00.0 chip ID: 10de:1f91 
           Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia compositor: kwin_x11 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.0.7 direct render: Yes

[marcosh@marcoshoisy ~]$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:modesetting
Provider 1: id: 0x256 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0

[marcosh@marcoshoisy ~]$ lsmod |grep -E 'nvidia|i915|nouveau|bbswitch|acpi_call'
nvidia_drm             57344  2
nvidia_modeset       1118208  3 nvidia_drm
nvidia              20512768  92 nvidia_modeset
ipmi_msghandler        73728  2 ipmi_devintf,nvidia
i915                 2519040  27
i2c_algo_bit           16384  1 i915
drm_kms_helper        249856  2 nvidia_drm,i915
cec                    69632  2 drm_kms_helper,i915
drm                   573440  13 drm_kms_helper,nvidia_drm,i915
intel_gtt              24576  1 i915

Still, the external monitor is not detected in this mode.

Moreover, as soon as I try to run prime-run glxgears the system freezes and I need to hard reboot. Where should I look for logs which could help me fix this issue?

Do optimus-manager --switch nvidia and then, after it fails, find the last log file in /var/log/optimus-manager/switch directory and post it here pls.

To me it now looks like you have HDMI wired to Nvidia chip and the only solution is to try the latest beta driver nvidia-beta-dkms from AUR.

This is the content of the last log file in /var/log/optimus-manager/switch

[18] INFO: # Xorg pre-start hook
[18] INFO: Requested mode is: intel
[18] INFO: Checking for GDM display servers
[414] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[415] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
[455] INFO: Loaded extra Intel Xorg options (0 lines)
[456] INFO: Loaded extra Intel Xorg options (0 lines)
[456] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[456] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20200708T222650', 'requested_mode': 'intel'}
[456] INFO: Xorg pre-start hook completed successfully.
[2] INFO: # Xorg post-start hook
[2] INFO: Running /etc/optimus-manager/xsetup-intel.sh
[9] INFO: Writing state {'type': 'done', 'switch_id': '20200708T222650', 'current_mode': 'intel'}
[9] INFO: Xorg post-start hook completed successfully.

Now I'll try to install the driver you mention. I suspect too that the HDMI port is directly connected to the Nvidia card

The log says that the requested mode was Intel. I expected to see Nvidia there. Is it really the last log file there AFTER trying to switch to Nvidia mode? If so, look through the previous one, I need to see that one that reports about Nvidia.

From what I saw, not log file on that path was mentioning Nvidia.

I tried to reinstall everything. I launched the following commands

  • sudo pacman -S yay vim
  • sudo pacman -S nvidiawith option linux56-nvidia-440xx
  • sudo mhwd -a pci nonfree 0300

at this point, if I reboot, after showing the login screen, the computer freezes and I can't do anything more

In running or of suggestions. In fact my experience is very limited. All I can come up with is trying regular Nvidia config in mhwd, not hybrid one, check bios settings and updates, and trying driver version 450.51 or 450.57.

Thanks, you've been very helpful. Talking with a friend we almost concluded that there is a software bug somewhere which does not allow my current configuration to work. I'll try to update and see if new releases solve the issue

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by