[SOLVED] Debian 11 Bullseye on Optimus laptop not detecting external screen
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Debian 11 Bullseye on Optimus laptop not detecting external screen
Hi, I have a problem with my Debian Bullseye laptop (using the KDE Plasma desktop envirnoment) connecting to an external screen.
I am on a Lenovo laptop with Optimus (CPU intel i7 and GPU Nvidia gtx 1650ti). I have installed the Nvidia proprietary drivers and they seem to work fine (launching applications with the GPU using Prime render offload works well). The problem is that when I plug in my ViewSonic external screen through my hdmi port, the laptop doesn't detect it. KDE Plasma display settings only detects my laptop screen, xrandr doesn't seem to detect the hdmi port. The only program that seems to know about the screen is nvidia-settings, which under the GPU says HDMI-1-0 - (ViewSonic VA2405-FHD).
To me it seems like the hdmi port is connected to the GPU and because of that the system is unable to use it, but I don't know how to solve it.
Linux g3deb 5.10.0-3-amd64 #1 SMP Debian 5.10.12-1 (2021-01-30) x86_64 GNU/Linux
I've searched for a solution but haven't found anything that would seem relevant so far. Tell me if you need any more information, and thanks in advance for any help.
#
# deb cdrom:[Debian GNU/Linux bullseye-DI-alpha3 _Bullseye_ - Official Snapshot amd64 NETINST 20201203-12:50]/ bullseye main
#deb cdrom:[Debian GNU/Linux bullseye-DI-alpha3 _Bullseye_ - Official Snapshot amd64 NETINST 20201203-12:50]/ bullseye main
deb http://deb.debian.org/debian/ bullseye main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/debian-security bullseye-security main
deb-src http://security.debian.org/debian-security bullseye-security main
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
I checked the link you mentioned, but I'm not sure how to use the solution, because I don't use nvidia-prime (I use prime render offload, as mentioned on this page of the wiki: https://wiki.debian.org/NVIDIA%20Opt...Render_Offload) and the file mentioned in the solution /lib/modprobe.d/nvidia-kms.conf doesn't exist.
From seeing your xrandr output, to me it seems like my xrandr doesn't detect the HDMI port, which I suspect is wired directly to the Nvidia GPU, but I'm not sure what to do to make xrandr see the port.
My Laptop has a hardware switch to toggle between Intel and Nvidia graphics and has to be toggled in Windows through software not through the firmware interface. When I link it to the TV via HDMI it works with either graphics device with my Debian Bullseye.
Quote:
From seeing your xrandr output, to me it seems like my xrandr doesn't detect the HDMI port, which I suspect is wired directly to the Nvidia GPU
I may be wrong but from what I gather, with Optimus machines, everything goes through the Intel graphics. Anyway, this article mentions enabling HDMI through Nvidia settings, which should be installed in Bullseye by default with nvidia-driver Debian binaries.
Perhaps your laptop has a way of enabling/disabling the HDMI via computer settings or a function key combination, external switch?.
I sadly can't show output to prime-select query, because Debian so far doesn't use prime-select, so the command isn't recognised.
In the Nvidia settings, it shows the HDMI, but there's no way to turn it on, the most I can do is change color controls or dithering controls and get the EDID, but nothing to turn the port on.
I have tried looking for a hardware switch, but I haven't found any key that would change anything.
I have found something that helps though, the command "xrandr --setprovideroutputsource NVIDIA-G0 modesetting" changes my xrandr output, now it sucessfuly detects the HDMI, and even the screen if it's connected! The only problem is that still, nothing shows up on the screen (it says no signal), even when I switch the mode to extend to the screen or to duplicate outputs.
New xrandr output looks like this when the screen is disconnected:
Hello again,
Good news, thanks to the discovery I wrote about in my last reply, I now managed to solve the problem and get it to work!
As I mentioned in the last post, even when xrandr finally detected the HDMI port, it still didn't actually output anything to the screen.
Well, after some experiments, I found out that all I had to do to get it to output to the screen was the command "xrandr --auto" to enable the output.
I think that the problem originally was that xrandr wasn't properly instructed to use the nvidia GPU and its ports, but it had access to it, because in my normal xrandr output, it didn't mention the HDMI port, but the command "xrandr --listproviders" actually did list the Nvidia card as a possible provider:
And it seems like the way to make xrandr use the nvidia GPU and its ports as well as the integrated one is the command "xrandr --setprovideroutputsource NVIDIA-G0(or whatever the name of the card is in the providers list) modesetting".
After this, the screen still didn't work, but I think that was because in xrandr the output to the HDMI was disabled, because just the simple command "xrandr --auto" to auto enable connected but disabled outputs fixed that. Now with these commands, the screen and the HDMI port in general seem to work!
I'm glad that it works now, thanks for the help guys.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.