Skip to content

fix(rpi): stop the kiosk login loop by pinning the vc4 display device - #6

Merged
danisss9 merged 1 commit into
mainfrom
claude/raspberry-pi-login-crash-bjy8gy
Aug 6, 2026
Merged

danisss9 merged 1 commit into
mainfrom
claude/raspberry-pi-login-crash-bjy8gy

Conversation

@danisss9

@danisss9 danisss9 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

On a Pi, dtoverlay=vc4-kms-v3d registers two DRM devices: vc4, which owns
the HDMI connectors, and v3d, a render-only core with no outputs. Their
/dev/dri/card* numbering is not stable, and when v3d lands on card0 Xorg's
modesetting driver binds to it, finds no screens and exits immediately.

The console is unaffected - fbcon is bound to vc4 - so the machine boots,
prints the banner, and then loops: startx was exec'd from .bash_profile, so
a failed session ended the login shell, agetty logged the user straight back
in, and the only explanation went to a log file inside a session that never
lasted long enough to read it.

  • Add the vc4 OutputClass/PrimaryGPU rule to the Pi overlay, matching on the
    kernel driver name rather than a card number. Raspberry Pi OS ships the
    same rule; Arch Linux ARM does not.
  • Run startx as a child of the login shell instead of exec'ing it. A session
    that lived logs out as before; three failures inside a few seconds stop the
    retries and leave a shell on tty1 with the tail of the session and kiosk
    logs on screen.
  • Fall back to software rendering when the editor exits immediately three
    times, and detect a usable DRM node instead of just /dev/dri existing.
  • Assert the vc4 rule made it into the image at build time, and document the
    console fallback.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01Mej775L1dYS9Hk6JtvcHCJ

On a Pi, dtoverlay=vc4-kms-v3d registers two DRM devices: vc4, which owns
the HDMI connectors, and v3d, a render-only core with no outputs. Their
/dev/dri/card* numbering is not stable, and when v3d lands on card0 Xorg's
modesetting driver binds to it, finds no screens and exits immediately.

The console is unaffected - fbcon is bound to vc4 - so the machine boots,
prints the banner, and then loops: startx was exec'd from .bash_profile, so
a failed session ended the login shell, agetty logged the user straight back
in, and the only explanation went to a log file inside a session that never
lasted long enough to read it.

- Add the vc4 OutputClass/PrimaryGPU rule to the Pi overlay, matching on the
  kernel driver name rather than a card number. Raspberry Pi OS ships the
  same rule; Arch Linux ARM does not.
- Run startx as a child of the login shell instead of exec'ing it. A session
  that lived logs out as before; three failures inside a few seconds stop the
  retries and leave a shell on tty1 with the tail of the session and kiosk
  logs on screen.
- Fall back to software rendering when the editor exits immediately three
  times, and detect a usable DRM node instead of just /dev/dri existing.
- Assert the vc4 rule made it into the image at build time, and document the
  console fallback.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mej775L1dYS9Hk6JtvcHCJ
@danisss9
danisss9 merged commit cf70104 into main Aug 6, 2026
@danisss9
danisss9 deleted the claude/raspberry-pi-login-crash-bjy8gy branch August 6, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants