Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Fixing a Black LightDM Login Screen on an AMD/NVIDIA PRIME Laptop

The issue

On some Linux laptops with:

  • an AMD integrated GPU connected to the internal display,
  • an NVIDIA discrete GPU used as the primary Xorg renderer,
  • LightDM and Xorg,
  • NVIDIA PRIME or reverse PRIME,

the boot splash completes but the internal screen turns black when the login screen should appear.

The computer may still be working normally:

  • The mouse cursor may remain visible or move.
  • Typing the password and pressing Enter may log in successfully.
  • SSH and other remote services may remain available.
  • Applications may continue running even if the local desktop stops updating.

This can be caused by two separate problems:

  1. LightDM starts Xorg before the AMD GPU and internal eDP panel are ready. Xorg initially sees only NVIDIA, then crashes while hot-adding AMD through glamor_init or AddGPUScreen.
  2. Ubuntu/Mint's legacy /sbin/prime-offload helper rejects the hardware and never connects the AMD output provider to NVIDIA. Slick Greeter runs, accepts keyboard input, but is not visible on the internal panel.

This was observed on Linux Mint 22.3 with an AMD Radeon 890M, NVIDIA RTX 5080 Laptop GPU, LightDM, Xorg, and a 2560x1600 240 Hz internal display. The same failure pattern may affect other AMD/NVIDIA PRIME laptops.

Step 0: Get access to the computer

You do not need a visible greeter to begin recovery.

Try these methods in order:

  1. Blind login: Wait for boot to finish, type your password, and press Enter. If the desktop appears, open a terminal.

  2. Switch to a text console: Press Ctrl+Alt+F3, log in, and run the commands from the console. Return to the graphical session later with Ctrl+Alt+F7 or Ctrl+Alt+F2, depending on the distribution.

  3. SSH: Connect from another machine if SSH is already enabled.

  4. Temporary integrated-GPU mode: From a text console or SSH, run:

    sudo prime-select intel
    sudo reboot

    On Ubuntu-derived systems, intel means the open-source integrated-GPU profile and also applies to AMD iGPUs. This is a recovery and diagnostic mode. It disables normal NVIDIA/CUDA access.

Return to hybrid mode before applying and testing the complete fix:

sudo prime-select on-demand
sudo reboot

1. Confirm this failure pattern

After logging in, inspect the current or previous boot:

journalctl -b 0 --no-pager | \
  grep -Ei 'Xorg|lightdm|glamor|AddGPUScreen|vblank wait timed out'

coredumpctl list /usr/lib/xorg/Xorg --no-pager

cat /var/log/prime-offload.log

Indicators for this specific problem include:

Xorg ... dumped core
dixRegisterPrivateKey
glamor_init
AddGPUScreen
amdgpu ... vblank wait timed out
Sorry but your hardware configuration is not supported

Check that the internal panel is connected to AMD:

for status in /sys/class/drm/card*-eDP*/status; do
    printf '%s: ' "$status"
    cat "$status"
done

At least one eDP connector should report connected.

2. Make LightDM wait for the internal panel

Create /usr/local/sbin/wait-for-internal-display:

#!/bin/sh

timeout=20
elapsed=0

while [ "$elapsed" -lt "$timeout" ]; do
    for status_file in /sys/class/drm/card*-eDP*/status; do
        [ -r "$status_file" ] || continue
        if [ "$(cat "$status_file")" = "connected" ]; then
            exit 0
        fi
    done

    sleep 1
    elapsed=$((elapsed + 1))
done

echo "Timed out waiting for the internal eDP display" >&2
exit 1

Install it:

sudo chmod 0755 /usr/local/sbin/wait-for-internal-display
sudo mkdir -p /etc/systemd/system/lightdm.service.d

Create /etc/systemd/system/lightdm.service.d/override.conf:

[Service]
ExecStartPre=/usr/local/sbin/wait-for-internal-display

Reload systemd:

sudo systemctl daemon-reload

This prevents Xorg from starting with only NVIDIA and then trying to hot-add the AMD display GPU during initialization.

3. Replace the unsupported PRIME display helper

First check the existing helper:

cat /var/log/prime-offload.log

If it says:

Sorry but your hardware configuration is not supported

create /usr/local/sbin/setup-prime-display:

#!/bin/sh

echo "Starting PRIME display setup" >&2
xrandr --listproviders

amd_provider=$(
    xrandr --listproviders |
        sed -n 's/.*name:\(AMD Radeon.*\)$/\1/p' |
        head -n 1
)
nvidia_provider=$(
    xrandr --listproviders |
        sed -n 's/.*name:\(NVIDIA-[^ ]*\).*$/\1/p' |
        head -n 1
)

if [ -z "$amd_provider" ] || [ -z "$nvidia_provider" ]; then
    echo "Required AMD and NVIDIA providers were not found" >&2
    exit 1
fi

xrandr --setprovideroutputsource "$amd_provider" "$nvidia_provider"
xrandr --auto

internal_output=$(
    xrandr --query |
        sed -n 's/^\([^ ]*eDP[^ ]*\) connected.*/\1/p' |
        head -n 1
)

if [ -z "$internal_output" ]; then
    echo "Connected internal eDP output was not found" >&2
    exit 1
fi

xrandr --output "$internal_output" --auto --primary
echo "Activated $internal_output through $amd_provider" >&2

Install it:

sudo chmod 0755 /usr/local/sbin/setup-prime-display

Create /etc/lightdm/lightdm.conf.d/99-prime-display.conf:

[Seat:*]
display-setup-script=/usr/local/sbin/setup-prime-display

This overrides the legacy display-setup-script=/sbin/prime-offload setting without modifying package-owned files.

4. Verify the configuration before rebooting

Confirm that LightDM sees the override:

lightdm --show-config

The effective configuration should contain:

display-setup-script=/usr/local/sbin/setup-prime-display

Validate the scripts and service:

sh -n /usr/local/sbin/wait-for-internal-display
sh -n /usr/local/sbin/setup-prime-display
systemd-analyze verify lightdm.service

Then reboot:

sudo reboot

5. Verify the repaired boot

After logging in:

journalctl -b 0 -u lightdm.service --no-pager
coredumpctl list --since="$(uptime -s)" --no-pager
xrandr --listproviders
xrandr --query
nvidia-smi

Expected results:

  • The LightDM log says the eDP output was activated through AMD.
  • There are no Xorg coredumps from this boot.
  • xrandr --listproviders shows both NVIDIA and AMD.
  • The internal eDP output is connected, primary, and using its intended mode.
  • nvidia-smi detects the NVIDIA GPU.

Example success message:

Activated eDP-1-1 through AMD Radeon ... 

This fix does not require reducing the panel refresh rate or disabling CUDA.

Rollback

If this configuration prevents LightDM from starting, use a text console or SSH and remove only the overrides added above:

sudo rm /etc/lightdm/lightdm.conf.d/99-prime-display.conf
sudo rm /etc/systemd/system/lightdm.service.d/override.conf
sudo rm /usr/local/sbin/setup-prime-display
sudo rm /usr/local/sbin/wait-for-internal-display
sudo systemctl daemon-reload
sudo reboot

Remaining issues this does not prove fixed

This procedure fixes the LightDM/Xorg startup race and invisible greeter. It does not, by itself, prove that every later compositor or GPU presentation freeze is resolved.

If the desktop later stops updating while the cursor still moves, leave the machine running and collect these remotely before rebooting:

journalctl -k --since='10 minutes ago' --no-pager | \
  grep -Ei 'amdgpu|nvidia|drm|vblank|timeout|reset|xid'

journalctl --user --since='10 minutes ago' --no-pager | \
  grep -Ei 'cinnamon|muffin|error|warning'

nvidia-smi
xrandr --listproviders
xrandr --query

Firmware ACPI errors such as AE_ALREADY_EXISTS or missing SystemCMOS handlers are a separate BIOS issue and are not corrected by this procedure.

About

Fix Xorg startup crashes and an invisible LightDM greeter on AMD/NVIDIA PRIME laptops

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors