Laptop display issues on Debian 11

Currently I am dual booting Debian 11 (with GNOME) and Windows 11 on my 2018 Razer Blade 15 Advanced, which has a discrete GPU (NVIDIA 1060M) running the newest Linux NVIDIA drivers (v515.48.07). I am trying to set up 2 external monitors in addition to the built-in laptop display. One of my displays is a Samsung LC27T55 which is hooked up with a native HDMI connection. The other display is a Achieva Shimian QH270 which natively only supports Dual Link DVI-D, but since my laptop doesn’t have a DVI connector I purchased this Apple Dual Link DVI to Mini Display port adapter. Now since my built in display seems to be only connected to the built in Intel graphics I had to offload the graphics processing of it to my GPU using this tutorial: Chapter 32. Offloading Graphics Display with RandR 1.4 of the NVIDIA Accelerated Linux Graphics Driver README and Installation Guide. The only difference from this tutorial I employed was putting:

$ xrandr --setprovideroutputsource modesetting NVIDIA-0
$ xrandr --auto

in ~/.xsessionrc as opposed to ~/.xinitrc since this is the only way I could get it to work.
However I run into two main issues:

  1. When I start up my laptop, my login screen only appears on my Samsung LC27T55 (and black on my built in display). Even if I disconnect all my external monitors, my built in display remains black on start up. I can still login by just pressing enter and putting in my password even though the screen is black, after which everything works perfectly, but this is still very undesirable.
  2. My Achieva Shimian QH270 has absolutely no output. It is detected by the system, but it will only “output” a resolution of 640x480. I say “output” because in reality the monitor is just black.

With regard to the first issue, I have tried adding the two xrandr lines above as a startup script (since I thought that maybe they were only being executed after login) but I don’t believe its the order of events that is the issue because once I login and everything is working, and then I logout, the issue persists. I have tried disabling Wayland and moving the ~/.config/monitors.xml to /var/lib/gdm3/.config/ (transferring my user display information to GNOME) but to no avail.

For the second issue I haven’t done much other than trying to add xrandr modes and set them, as well as applying a custom EDID which I found on a GitHub page (which seemed to be a bust because when I decoded the binary there was nothing of substance) and just resulted in my computer completely black-screening. I know with certainty that the monitor and adapter work because I have tried it on the Windows 11 partition and it worked with no hesitation.

I have included the log file created by nvidia-bug-report.sh as well as some standard outputs which may be useful. Any help would be awesome!!!

nvidia-smi:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.48.07    Driver Version: 515.48.07    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| N/A   62C    P5    10W /  N/A |    414MiB /  6144MiB |     25%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      5373      G   /usr/lib/xorg/Xorg                216MiB |
|    0   N/A  N/A      5488      G   /usr/bin/gnome-shell               67MiB |
|    0   N/A  N/A      8469      G   ...717975381964499814,131072      104MiB |
|    0   N/A  N/A     10525      G   /usr/bin/nvidia-settings            0MiB |
|    0   N/A  N/A     12097      G   gnome-control-center               21MiB |
+-----------------------------------------------------------------------------+

xrandr --listproviders:

Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 3 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x1ff cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 3 associated providers: 1 name:modesetting

xrandr --listmonitors:

Monitors: 3
 0: +*eDP-1-1 1920/344x1080/194+0+0  eDP-1-1 // Built-in display
 1: +HDMI-0 1920/522x1080/272+1920+0  HDMI-0 // Samsung LC27T55
 2: +DP-0 640/169x480/127+3840+208  DP-0 // Achieva Shimian QH270

xrandr:

Screen 0: minimum 8 x 8, current 4480 x 1080, maximum 32767 x 32767
HDMI-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 522mm x 272mm
   1920x1080     60.00 +  74.97*   59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94  
DP-0 connected 640x480+3840+208 (normal left inverted right x axis y axis) 0mm x 0mm
   640x480       59.94*+
DP-1 disconnected (normal left inverted right x axis y axis)
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080    144.00*+  60.01    59.97    59.96    60.00    59.93  
   1680x1050     84.94    74.89    69.88    59.95    59.88  
   1600x1024     60.17  
   1400x1050     85.00    74.76    70.00    59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     85.02    75.02    60.02  
   1440x900      59.89  
   1400x900      59.96    59.88  
   1280x960      85.00    60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1360x768      59.80    59.96  
   1280x800      59.99    59.97    59.81    59.91  
   1152x864     100.00    85.06    85.00    75.00    75.00    70.00    60.00  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      85.00    75.05    60.04    85.00    75.03    70.07    60.00  
   1024x768i     86.96  
   960x720       85.00    75.00    60.00  
   928x696       75.00    60.05  
   896x672       75.05    60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   832x624       74.55  
   960x540       59.96    59.99    59.63    59.82  
   800x600       85.00    75.00    70.00    65.00    60.00    85.14    72.19    75.00    60.32    56.25  
   840x525       85.02    74.96    69.88    60.01    59.88  
   864x486       59.92    59.57  
   800x512       60.17  
   700x525       85.08    74.76    70.06    59.98  
   800x450       59.95    59.82  
   640x512       85.02    75.02    60.02  
   720x450       59.89  
   700x450       59.96    59.88  
   640x480       85.09    60.00    85.01    72.81    75.00    59.94  
   720x405       59.51    58.99  
   720x400       85.04  
   684x384       59.88    59.85  
   680x384       59.80    59.96  
   640x400       59.88    59.98    85.08  
   576x432      100.11    85.15    85.09    75.00    75.00    70.00    60.06  
   640x360       59.86    59.83    59.84    59.32  
   640x350       85.08  
   512x384       85.00    75.03    70.07    60.00  
   512x384i      87.06  
   512x288       60.00    59.92  
   416x312       74.66  
   480x270       59.63    59.82  
   400x300       85.27    72.19    75.12    60.32    56.34  
   432x243       59.92    59.57  
   320x240       85.18    72.81    75.00    60.05  
   360x202       59.51    59.13  
   360x200       85.04  
   320x200       85.27  
   320x180       59.84    59.32  
   320x175       85.27  
DP-1-1 disconnected (normal left inverted right x axis y axis)
DP-1-2 disconnected (normal left inverted right x axis y axis)
  1680x1050 (0x1c2) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1280x1024 (0x1c5) 135.000MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock  79.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  75.02Hz
  1280x1024 (0x1c6) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1440x900 (0x1c4) 106.500MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
        v: height  900 start  903 end  909 total  934           clock  59.89Hz
  1280x800 (0x1c7) 83.500MHz -HSync +VSync
        h: width  1280 start 1352 end 1480 total 1680 skew    0 clock  49.70KHz
        v: height  800 start  803 end  809 total  831           clock  59.81Hz
  1152x864 (0x1cb) 108.000MHz +HSync +VSync
        h: width  1152 start 1216 end 1344 total 1600 skew    0 clock  67.50KHz
        v: height  864 start  865 end  868 total  900           clock  75.00Hz
  1024x768 (0x1cc) 78.750MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock  60.02KHz
        v: height  768 start  769 end  772 total  800           clock  75.03Hz
  1024x768 (0x1cd) 75.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1328 skew    0 clock  56.48KHz
        v: height  768 start  771 end  777 total  806           clock  70.07Hz
  1024x768 (0x1ce) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x1d0) 50.000MHz +HSync +VSync
        h: width   800 start  856 end  976 total 1040 skew    0 clock  48.08KHz
        v: height  600 start  637 end  643 total  666           clock  72.19Hz
  800x600 (0x1cf) 49.500MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock  46.88KHz
        v: height  600 start  601 end  604 total  625           clock  75.00Hz
  800x600 (0x1d1) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x1d2) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz
  640x480 (0x1d5) 31.500MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock  37.50KHz
        v: height  480 start  481 end  484 total  500           clock  75.00Hz
  640x480 (0x1d7) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz

sudo lshw -C display:

  *-display                 
       description: VGA compatible controller
       product: GP106M [GeForce GTX 1060 Mobile]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:149 memory:ac000000-acffffff memory:80000000-8fffffff memory:90000000-91ffffff ioport:3000(size=128) memory:ad000000-ad07ffff
  *-display
       description: VGA compatible controller
       product: CoffeeLake-H GT2 [UHD Graphics 630]
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:140 memory:ab000000-abffffff memory:40000000-4fffffff ioport:4000(size=64) memory:c0000-dffff

cat /etc/X11/xorg.conf

Section "ServerLayout"
	Identifier     "layout"
	Screen         0 "nvidia"
	Inactive       "intel"
EndSection

Section "Device"
	Identifier  "intel"
	Driver      "modesetting"
EndSection

Section "Device"
	Identifier  "nvidia"
	Driver      "nvidia"
	BusID       "PCI:1:0:0"
EndSection

Section "Screen"
	Identifier "intel"
	Device     "intel"
EndSection

Section "Screen"
	Identifier "nvidia"
	Device     "nvidia"
EndSection

nvidia-bug-report.log.gz (649.0 KB)

If you would like links to any of the aforementioned references. Please do ask, unfortunately NVIDIA only allows me to put in one link since I am a new user -____-

Did you have any luck with the first issue?

I’ve got the same issue with a Dell laptop running Debian, with an Internal Intel 630 and an NVIDIA GTX 1050 Ti for external.

Every step included in case it helps someone else.

Initially, I installed the NVIDIA Non-free drivers:
sudo nano /etc/apt/sources.list
Add in:

##------------------------------------------------------------------------------------------
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian-security bullseye/updates main contrib non-free
deb-src http://deb.debian.org/debian-security bullseye/updates main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free

deb http://ftp.uk.debian.org/debian/ bullseye main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ bullseye main contrib non-free
##------------------------------------------------------------------------------------------

Ctrl+S (save)
Ctrl+X (exit)

Then update the packages list, install and run nvidia-detect to make sure it detects your device and confirms the driver to use:

sudo apt update
sudo apt install nvidia-detect
nvidia-detect

e.g.

$ nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] [10de:1c8c] (rev a1)
Checking card: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)
Your card is supported by all driver versions.
Your card is also supported by the Tesla 470 drivers series.
Your card is also supported by the Tesla 450 drivers series.
Your card is also supported by the Tesla 418 drivers series.
It is recommended to install the
nvidia-driver
package.

Install (if they’re already installed, they should say they are both say they’re the latest)

sudo apt install linux-headers-amd64
sudo apt install nvidia-driver firmware-misc-nonfree
sudo apt install nvidia-driver

(accept the warning and reboot after)

Once back up, and after each login, manually connect the external display (the actual config will differ for each users’ setup):

sudo xrandr --setprovideroutputsource NVIDIA-G0 modesetting
sudo xrandr --auto
xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto; xrandr --output eDP-1-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-0 --mode 1920x1080 --pos 1920x0 --rotate normal --right-of eDP-1-1

I also used the nvidia-configure, which created the xorg.conf file, I’ve since deleted that.

Following the amazing support from @generix (and others) on nvidia-xconfig doesnt do what i want it to, nor does nvidia-settings - #7 by generix (I can’t post more than one link), I’ve done the following:

sudo nano usr/share/X11/xorg.conf.d/10-amdgpu.conf (only set Driver to “modesetting”)

Section “OutputClass”
Identifier “AMDgpu”
MatchDriver “amdgpu”
Driver “modesetting”
EndSection

sudo nano /usr/share/X11/xorg.conf.d/nvidia-drm-outputclass.conf (no change)

#This xorg.conf.d configuration snippet configures the X server to
#automatically load the nvidia X driver when it detects a device driven by the
#nvidia-drm.ko kernel module. Please note that this only works on Linux kernels
#version 3.9 or higher with CONFIG_DRM enabled, and only if the nvidia-drm.ko
kernel module is loaded before the X server is started.
Section “OutputClass”
Identifier “nvidia”
MatchDriver “nvidia-drm”
Driver “nvidia”
EndSection

sudo nano /usr/share/X11/xorg.conf.d/10-nvidia.conf (didn’t exist, so created)

Section “OutputClass”
Identifier “nvidia”
MatchDriver “nvidia-drm”
Driver “nvidia”
Option “AllowEmptyInitialConfiguration”
Option “PrimaryGPU” “Yes”
ModulePath “/usr/lib/x86_64-linux-gnu/nvidia/xorg”
EndSection

/xorg doesn’t exist, I tried changing it to /current and it does exactly the same:

$ ls /usr/lib/x86_64-linux-gnu/nvidia/
current  libnvidia-cfg.so.1
$ ls -Al /usr/share/X11/xorg.conf.d/
10-amdgpu.conf
10-nvidia.conf
10-quirks.conf
10-radeon.conf
40-libinput.conf
70-wacom.conf
nvidia-drm-outputclass.conf -> /etc/alternatives/glx--nvidia-drm-outputclass.conf

sudo nano /etc/xdg/autostart/optimus.desktop (created the file)

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto; xrandr --output eDP-1-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-0 --mode 1920x108>
NoDisplay=false
X-GNOME-Autostart-Phase=DisplayServer

Copied the file to the second folder
sudo cp /etc/xdg/autostart/optimus.desktop /usr/share/gdm/greeter/autostart/optimus.desktop

From all this, I’ve configured it to start at boot. The external display is now the one with the login dialog, like yours, the built-in display is blank until logged in, at which point, it correctly becomes the default display and the external display is working as expected.

The problem I have is: if the external display is not connected, I can’t see anything on the internal display until I type in my username/password into the invisible login prompt.

$ sudo lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)

$ xrandr | grep connect
HDMI-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 531mm x 299mm
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
DP-1-1 disconnected (normal left inverted right x axis y axis)

I don’t know how to start startx with logverbose 6, but I’ve run sudo nvidia-bug-report.sh and attached.
nvidia-bug-report.log.gz (641.2 KB)

Gnome ignores Xsession files, please create .desktop files::
https://forums.developer.nvidia.com/t/official-driver-384-59-with-geforce-1050m-doesnt-work-on-opensuse-tumbleweed-kde/52620/2?u=generix

For your incorrectly detected Achieva monitor, please see this thread:
https://forums.developer.nvidia.com/t/laptop-ubuntu-20-04-only-nativ-screen-turns-black-when-nvidia-card-takes-over-missing-edid/226503/2?u=generix

@generix - thanks for replying, I take it that’s for the OP @markkoszykowski, but I do have the desktop files like you mentioned in the linked post (that I couldn’t link to as I’m new here, but have been able to edit it now). My post was moderated and has only just been released 20 minutes ago, sorry.

…and that’s why you shouldn’t take over old threads…
@Aubs ,your logs look like you don’t even use gdm as DM so the .desktop file has no effect. Please check which display-manager is used and then change it accordingly:
https://wiki.archlinux.org/title/NVIDIA_Optimus#Display_managers