Black screen after login with KDE/Wayland because of .bash_profile script (not with KDE/X11)

I have a laptop system (Dell E6540) with the following specs:

emk2203@e6540:~$ inxi -GSC -xx -c 0
  Host: e6540 Kernel: 6.7.9-arch1-1 arch: x86_64 bits: 64 compiler: gcc
    v: 13.2.1
  Desktop: KDE Plasma v: 6.0.1 tk: Qt v: N/A wm: kwin_x11 dm: SDDM
    Distro: EndeavourOS base: Arch Linux
  Info: quad core model: Intel Core i7-4810MQ bits: 64 type: MT MCP
    arch: Haswell rev: 3 cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
  Speed (MHz): avg: 887 high: 1500 min/max: 800/3800 cores: 1: 800 2: 800
    3: 800 4: 800 5: 800 6: 800 7: 1500 8: 800 bogomips: 44712
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Dell
    driver: i915 v: kernel arch: Gen-7.5 ports: active: eDP-1 empty: DP-1,
    DP-2, HDMI-A-1, HDMI-A-2, HDMI-A-3, VGA-1 bus-ID: 00:02.0
    chip-ID: 8086:0416
  Device-2: AMD Mars XTX [Radeon HD 8790M] vendor: Dell driver: radeon
    v: kernel arch: GCN-1 pcie: speed: 8 GT/s lanes: 8 ports: active: none
    empty: VGA-2 bus-ID: 01:00.0 chip-ID: 1002:6606 temp: 41.0 C
  Device-3: Microdia Integrated Webcam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-1.5:3 chip-ID: 0c45:64d0
  Display: x11 server: X.Org v: 21.1.11 with: Xwayland v: 23.2.4
    compositor: kwin_x11 driver: X: loaded: intel,radeon unloaded: modesetting
    alternate: fbdev,vesa dri: i965,radeonsi gpu: i915 display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96
  Monitor-1: eDP-1 mapped: eDP1 model: AU Optronics 0x11ed res: 1920x1080
    dpi: 143 diag: 394mm (15.5")
  API: EGL v: 1.5 platforms: device: 0 drv: radeonsi device: 1 drv: crocus
    device: 2 drv: swrast surfaceless: drv: radeonsi x11: drv: crocus
    inactive: gbm,wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.0.2-arch1.2
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel HD Graphics 4600 (HSW
    GT2) device-ID: 8086:0416
  API: Vulkan Message: No Vulkan data available.

When I try to switch my KDE session to Wayland, I only get a black screen after entering the password and pressing Enter. System is running, but when I switch to a tty with Ctrl-Alt-F3, I get the login screen of SDDM again instead of the console.

Switching to X works, but with KDE6, I wanted to migrate the system to Wayland.

Any help?

I’m really suspecting that this issue is related to hybrid graphics. A lot of the issue I have seen on this are related to hybrid graphics with a few exceptions. My only suggestion is to wait it out on x11.

I am quite sure that this is due to the hybrid graphics and amdgpu / radeon. A couple of similar reports, but no solution in sight. :slightly_frowning_face:

Makes me question the real usefulness of AMD on Linux. Problems with nvidia hybrids are less severe.

Just out of curiosity, is it possible to disable dGPU in BIOS and use only iGPU on Plasma-Wayland to test?

I believe a bunch of the Nvidia hybrids are also having the black screen issue.

No. The video section lets me adjust brightness for battery and AC, and that’s it. And the GPU circuit board holds the VGA-15 out, and it is cumbersome to remove, otherwise I would have done this already.

1 Like

Right! I don’t own a system with hybrid graphics, otherwise I wouldn’t have asked.

Btw, you may be able to disable the dGPU through some kernel boot options preventing the driver to be loaded?

Just my own anecdotal experience. For me, the AMD laptop has more issues than the nvidia laptop, both with hybrid graphics.

Interesting to hear that others also have the black screen issue with nvidia.

They seem to come in several variants, so it’s always a valid question. Trying to disable the dGPU should be worth a try. I hope it’s possible. I have another laptop where I know that the dGPU is hardwired in such a way that it’s impossible to disable or even change the screen resolution.

Dell doing Dell things.

1 Like

I have the same problem, blacksreen with plasma 6 and wayland, while plasma 6 and x11 is working and also gnome with wayland is working. But I have no hybrid system, just only nvidia 3080ti. Strange is that i can start apllications when I click on upper left corner I get the search widget. I can start steam and konsole and also my browser…

Have you tried blacklisting nouveau on boot so it only uses internal graphics amdgpu on boot and then you switch to nvidia after via what ever method being used?

Are you saying that you can do all of that despite the black screen?

My fix for this while using Wayland in the VM is to raise the Video Memory to Max and optional add 3D Acceleration.

When I start the desktop after login a black screen is showning up with only window from Welcome (Autostart) is displayed. No taskbar no background.
When I move the mouse to upper left corner it shows the search inputline and the two workspaces. Here I can search for the terminal and from there I can start the applications. Hope that was more clear.

1 Like

If you delete the $HOME/.local/screen folder and the $HOME/.config/kwinoutputconfig.json and then reboot. Does that help? That would delete all monitor settings. Make sure no old config is conflicting.

No makes no differences. I will stay at x11 and try again after a while maybe a clean install will help.

1 Like

After the brief interlude with @Jerik 's issue, I’m back with some new findings.

System is now running kernel 6.8.0 and KDE 6.0.2. Issues at login persist. However:

  • When I try to login, I get the black screen. I can switch to a tty, though.
    • When I use tty3, black screen doesn’t change.
    • When I use tty4, the tty login appears. As soon as I try to login (usually at the password stage), the cursor appears and I get thrown back to SDDM’s login screen.
    • A subsequent attempt to login here gets a black screen, but now tty4 behaves the same as with tty3 before. I can’t switch to it anymore (black screen).
    • I can switch to tty5, which behaves the same as tty4 (SDDM login screen appears after cursor).
  • When I don’t try to login, I can switch to tty4 (not tty3) and login there. Afterwards, the tty3 login becomes available. Switching back to tty2 now gives me the SDDM login screen, which let’s me login now successfully to the Wayland session.

With some further experimentation, it seems I can login on tty3, but it takes a long time to switch to it.

Any further ideas? Workaround for now is:

  1. Switch to tty4 with Ctrl-Alt-F4 on the SDDM login screen
  2. Login on tty
  3. Switch back to SDDM via Alt-F2
  4. Login to KDE/Wayland session, enjoy.

This works to let me login under Wayland.

Where would be the place to report this upstream? Is this KDE, SDDM, Plasma, Wayland, Meta? I would like to report this, but where?

Some log findings with journalctl -b 0:

Process 578 (Xorg) of user 0 dumped core.
Mär 13 15:35:21 e6540 sddm[571]: Failed to read display number from pipe
Mär 13 15:35:21 e6540 sddm[571]: Display server stopping...
Mär 13 15:35:21 e6540 sddm[571]: Attempt 1 starting the Display server on vt 2 failed
Mär 13 15:35:23 e6540 sddm[571]: Display server starting...
Mär 13 15:35:23 e6540 sddm[571]: Writing cookie to "/run/sddm/xauth_cUrbzE"
Mär 13 15:35:23 e6540 sddm[571]: Running: /usr/bin/X -nolisten tcp -background none -seat seat0 vt2 -auth /run/sddm/xauth_cUrbzE -noreset -displayfd 16
Mär 13 15:35:24 e6540 sddm[571]: Setting default cursor
Mär 13 15:35:24 e6540 sddm[571]: Running display setup script  "/usr/share/sddm/scripts/Xsetup"
Mär 13 15:35:24 e6540 sddm[571]: Display server started.
Mär 13 15:35:24 e6540 sddm[571]: Socket server starting...
Mär 13 15:35:24 e6540 sddm[571]: Socket server started.
Mär 13 15:35:24 e6540 sddm[571]: Loading theme configuration from "/usr/share/sddm/themes/breeze/theme.conf"
Mär 13 15:35:24 e6540 sddm[571]: Greeter starting...
Mär 13 15:35:24 e6540 sddm-helper[634]: [PAM] Starting...
Mär 13 15:35:24 e6540 sddm-helper[634]: [PAM] Authenticating...
Mär 13 15:35:24 e6540 sddm-helper[634]: [PAM] returning.
Mär 13 15:35:24 e6540 sddm-helper[634]: Writing cookie to "/tmp/xauth_fsFGEw"
Mär 13 15:35:24 e6540 sddm-helper[634]: Starting X11 session: "" "/usr/bin/sddm-greeter-qt6 --socket /tmp/sddm-:0-zMtsty --theme /usr/share/sddm/themes/breeze"
Mär 13 15:35:24 e6540 sddm[571]: Greeter session started successfully
Mär 13 15:35:51 e6540 sddm-greeter-qt6[648]: file:///usr/share/sddm/themes/breeze/Main.qml:241:17 Parameter "username" is not declared. Injection of parameters into>
Mär 13 15:35:51 e6540 sddm-greeter-qt6[648]: Reading from "/usr/share/wayland-sessions/plasma.desktop"
Mär 13 15:35:51 e6540 sddm[571]: Message received from greeter: Login
Mär 13 15:35:51 e6540 sddm[571]: Reading from "/usr/share/wayland-sessions/plasma.desktop"
Mär 13 15:35:51 e6540 sddm[571]: Session "/usr/share/wayland-sessions/plasma.desktop" selected, command: "/usr/lib/plasma-dbus-run-session-if-needed /usr/bin/startp>
Mär 13 15:35:51 e6540 sddm-helper[716]: [PAM] Starting...
Mär 13 15:35:51 e6540 sddm-helper[716]: [PAM] Authenticating...
Mär 13 15:35:51 e6540 sddm-helper[716]: [PAM] Preparing to converse...
Mär 13 15:35:51 e6540 sddm-helper[716]: [PAM] Conversation with 1 messages
Mär 13 15:35:51 e6540 sddm-helper[716]: pam_kwallet5(sddm:auth): pam_kwallet5: pam_sm_authenticate
Mär 13 15:35:51 e6540 sddm-helper[716]: [PAM] returning.
Mär 13 15:35:51 e6540 sddm[571]: Authentication for user  "emk2203"  successful
Mär 13 15:35:51 e6540 sddm-greeter-qt6[648]: Message received from daemon: LoginSucceeded
Mär 13 15:35:51 e6540 sddm-helper[716]: pam_kwallet5(sddm:setcred): pam_kwallet5: pam_sm_setcred
Mär 13 15:35:51 e6540 sddm-helper[716]: pam_unix(sddm:session): session opened for user emk2203(uid=1000) by emk2203(uid=0)
1 Like

OK, I solved the issue.

It has nothing to do with amdgpu or plasma6.

It has to do with wayland, though, although I’m not sure about the mechanism.

I have a .bash_profile file which mounts all the removable stuff and Windows disks currently present upon login:

# ~/.bash_profile

[[ -f ~/.bashrc ]] && . ~/.bashrc

# mount unmounted disks available to system

for disk in /dev/disk/by-uuid/*; do
    if ! [[ $(lsblk -no FSTYPE $disk) =~ ^(swap|zfs_member)$ ]]; then
    findmnt -t noswap $disk >/dev/null || udisksctl mount -b $disk

This worked well before with X. All disks were mounted automatically upon login, I could use find to search for files and not risking to get a negative result because I forgot to mount a flash drive and search frantically in other places for hours.

This doesn’t work with Wayland, the above snippet stops and asks for authentification ‘somewhere’ (not visible anywhere). My workaround made me authenticate the unmounted drives and then the login could proceed, since there was no need for authentification anymore.

Solution is to move this to a bash function which I can call after login. There’s still the pesky authorization, though. A udisksctl mount -b issued from the local console doesn’t need it. A remote console does, though.

Why do I have to authorize the function, but not the udisksctl command? No idea. Maybe someone here knows?

1 Like

Isn’t it possible to auto-mount those devices upon boot via entries in /etc/fstab , adding --nofail mount option in case they are not connected at boot?

No. This suggestion comes up often when I discuss this, but doesn’t account for the unknowns of flash drives, attached external drives, inserted SD cards etc, which can all have different names, UUIDs and be at different places.

The ‘standard’ disks which get mounted all the time are in fstab, sure. But what about the others?

The way I had it was able to mount anything connected without a fuss. And I certainly don’t want to edit fstab entries all the time, given the risk of a non-booting system when you make an error.