SDDM only works with External Monitor

Hi everyone,

My laptop is an Asus Proart 13 with an AMD integrated GPU and an NVIDIA discrete GPU.

Running GDM, everything works fine on both the Nouveau driver as well as the NVIDIA drivers. However when I switch to SDDM, the laptop’s built in screen is blank after boot, while a connected external monitor is working.

All the docs and configs on sddm don’t seem to show anything I can change. I have tried the following options in /etc/modprobe.d:

options nvidia_drm modeset=1 fbdev=1
options nvidia "NVreg_UsePageAttributeTable=1"
options nvidia "NVreg_PreserveVideoMemoryAllocations=1"
options nvidia "NVreg_TemporaryFilePath=/var/tmp"
options nvidia "NVreg_EnableS0ixPowerManagement=1"

I would appreciate any guidance on this.

Thanks

Did you find this report?:

It sounds similar to what you are reporting. But that report is two years old.

Edit: Here is a different workaround someone found for their system:

Thank you for that. I tried the first suggestion but it didn’t work. As for the second, I really want to stick to Wayland.

This whole endeavor is part of my diagnosing a problem with running Hyprland on Wayland where the behavior is basically the same. Works with the external monitor but not built in.
Whereas GDM and Gnome both work on both monitors.

The funny thing is that if I disable my nvidia drivers (both proprietary and nouveau behave the same) and run with the AMD iGPU the opposite happens. Builtin monitor works and external is not recognized but in this case it’s the same for SDDM and GDM as well as Gnome and Hyprland.

There might be some hints about what is going wrong in some of these excerpts:

lwn.net – Linux on the Mac – state of the union:

GPU switching
Apple is the only remaining vendor to build a multiplexer into hybrid graphics laptops, which have both high-end and low-power GPUs. The multiplexer allows the panel to be switched between the GPUs and the unused GPU to be powered off. All other manufacturers use a “muxless” solution, whereby the discrete GPU is headless and copies rendered data over PCIe into the integrated GPU’s framebuffer. “Muxed” solutions, such as the one used by Apple, offer superior power saving and latency, but are more difficult to implement.

lore.kernel.org/dri-devel – April 2020:

Binding wise that looks like a good fit. I then thought about the
implementation and figured we’d end up with something like a bridge that
basically muxes inputs - or did you have something different in mind? That
sounds generally useful when we e.g. look at runtime switching the input
display controller.

That’s exactly what I have in mind. There’s a video-mux driver in V4L2
that does exactly this, we would need something similar for DRM/KMS.
There’s an additional challenge in that bridges are supposed to have a
single input and a single output at the moment, so API extensions would
be needed, which could take some time to get right. Shortcuts may be
possible to achieve a first implementation that would hardcode a
particular input, as long as the DT bindings are fine.

So it looks like for hybrid GPU systems there is a muxed (multiplexed) way of handling them where you get one or the other and there is a “muxless” solution where the output from one GPU is piped through the other. It also looks like the kernel developers have been working on getting the muxed solution working better for improved power savings.

As usual, it looks like the Arch wiki has some of the best documentation that I can find:

https://wiki.archlinux.org/title/Hybrid_graphics

HTH,
gb

Edit: Seeing that power management might be a factor in what is going wrong, you might check the driver parameters to see if there is a way of turning off the power saving. For example:

Excerpted from docs.kernel.org – amdgpu – module-parameters:

runpm (int)

Override for runtime power management control for dGPUs. The amdgpu driver can dynamically power down the dGPUs when they are idle if supported. The default is -1 (auto enable). Setting the value to 0 disables this functionality. Setting the value to -2 is auto enabled with power down when displays are attached.

Ok so I tried adding amdgpu.runpm = 0 to disable the power down functionality and tried the -2 setting for completeness as well. Unfortunately it didn’t work.

The thing is that SDDM is running without errors as evidenced by the logs. The built in screen just doesn’t work. If I have the external monitor connected, the login screen shows there, but if it isn’t then it just doesn’t show. However if I press a key followed by my password, it logs in and KDE starts normally.

Does this problem report match yours?:

https://bugzilla.redhat.com/show_bug.cgi?id=2302247

Not exactly. The case in that report, SDDM doesn’t work at all, and the system doesn’t accept keyboard input as well. In my case I am actually able to log in by pressing a key and then entering my password. I am also able to switch tty ctrl-alt-f3. Also, when and external monitor is plugged in, the login screen is displayed on the external monitor.

In your earlier post, you stated that you tried amdgpu.runpm = 0 (with spaces). Those parameters on the kernel command line are delimited by spaces, so if that is really what you used, then you inadvertently passed three parameters – amdgpu.runpm, =, and 0 – all of which would have been considered invalid and ignored. Kernel parameters need to be passed without spaces.

Other than that, I’m out if ideas. Sorry.

Edit: One more idea – looking closer at the docs, it appears that the runpm setting is for the discrete GPU (dGPU), but you are saying it is your built-in display that is powering off. The built-in display might be attached to the integrated GPU (iGPU), in which case, it might be amdgpu.dpm=0 that you need to set to disable power management for that GPU.

So you see a KDE desktop on the internal display?

Have you used a desktop configuration with disabled internal display as the default configuration for SDDM in the past?
Check the files in `/var/lib/sddm/.config/'.

There are also systems with DP/HDMI ports hard wired to the dGPU and USB-C ports wired to the iGPU.
output of ls -l /sys/class/drm/ could help.

My earlier post was a typo, I actually had it without spaces amdgpu.runpm=0. I did actually try all the options for this setting. None of them worked.

I really appreciate your help and suggestions, thank you.

Yes, once logged in, KDE appears on both internal and external displays.

I have not disabled internal display at all at any time. I looked at the files in /var/lib/sddm/.config/. As far as I can tell both displays are listed.

Something else that happens, is that when I completely disable the dGPU by going into the Asus controls in windows (which in my laptop disables HDMI output completely) then SDDM works on the internal display. :man_shrugging:

…listed and enabled?
Find the “outputs”: block in file kwinoutputconfig.json and verify that both screens have the line "enabled": true.

I have three relevant entries here. a "lidClosed": false that lists both outputs, index 0 and 1 as enabled. But then subsequent entries list index 1 only which I believe is the built in screen since it is listed first earlier. Below is the full json file. I am also not sure how to make changes here since I read that they are over-written by KDE?

[
    {
        "data": [
            {
                "allowSdrSoftwareBrightness": false,
                "autoRotation": "InTabletMode",
                "brightness": 1,
                "colorProfileSource": "EDID",
                "connectorName": "HDMI-A-1",
                "edidHash": "f03e0c791a05da9d34c2ee210a8ae99d",
                "edidIdentifier": "GSM 23304 531673 4 2019 0",
                "highDynamicRange": false,
                "iccProfilePath": "",
                "mode": {
                    "height": 2160,
                    "refreshRate": 60000,
                    "width": 3840
                },
                "overscan": 0,
                "rgbRange": "Automatic",
                "scale": 1.25,
                "sdrBrightness": 200,
                "sdrGamutWideness": 0,
                "transform": "Normal",
                "vrrPolicy": "Automatic",
                "wideColorGamut": false
            },
            {
                "allowSdrSoftwareBrightness": false,
                "autoRotation": "InTabletMode",
                "brightness": 1,
                "colorProfileSource": "sRGB",
                "connectorName": "eDP-1",
                "edidHash": "59556dee8057dcd913e4aae0659727a1",
                "edidIdentifier": "SDC 16816 0 0 2023 0",
                "highDynamicRange": true,
                "iccProfilePath": "",
                "mode": {
                    "height": 1800,
                    "refreshRate": 60001,
                    "width": 2880
                },
                "overscan": 4,
                "rgbRange": "Automatic",
                "scale": 1.5,
                "sdrBrightness": 400,
                "sdrGamutWideness": 0,
                "transform": "Normal",
                "vrrPolicy": "Automatic",
                "wideColorGamut": true
            }
        ],
        "name": "outputs"
    },
    {
        "data": [
            {
                "lidClosed": false,
                "outputs": [
                    {
                        "enabled": true,
                        "outputIndex": 0,
                        "position": {
                            "x": 0,
                            "y": 0
                        },
                        "priority": 0
                    },
                    {
                        "enabled": true,
                        "outputIndex": 1,
                        "position": {
                            "x": 3072,
                            "y": 0
                        },
                        "priority": 1
                    }
                ]
            },
            {
                "lidClosed": false,
                "outputs": [
                    {
                        "enabled": true,
                        "outputIndex": 1,
                        "position": {
                            "x": 0,
                            "y": 0
                        },
                        "priority": 0
                    }
                ]
            },
            {
                "lidClosed": true,
                "outputs": [
                    {
                        "enabled": true,
                        "outputIndex": 1,
                        "position": {
                            "x": 0,
                            "y": 0
                        },
                        "priority": 0
                    }
                ]
            }
        ],
        "name": "setups"
    }
]

the x positon 3072 seems strange, and does not match your monitors at all
HDMI is 4K x= 3840 , eDP has a width of x=2880.

There should be a similar file in $HOME/.config/.

Have you tried to apply plasma settings of your desktop session to sddm?
You could experiment which config works best, laptop screen defined as primary, ext. display disabled, etc.

You can undo the change to your desktop configuration after you have appplied the settings to sddm.

I tried this and while the changes do seem to get reflected in kwinoutputconfig.json they don’t seem to make a difference to the monitor situation. The HDMI output was showing "enabled": false while eDP was showing "enabled": true. Other things such as the background changes are taking effect.

Have you looked though the dmesg logs to see if you can find any hints about what might be going wrong?