Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd user service causes race condition #3653

Open
2 tasks done
whacka opened this issue Feb 10, 2025 · 0 comments
Open
2 tasks done

Systemd user service causes race condition #3653

whacka opened this issue Feb 10, 2025 · 0 comments

Comments

@whacka
Copy link

whacka commented Feb 10, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

None

Describe the Bug

Hi,
I'm currently using Sunshine on Fedora 41, with KDE and an NVIDIA card.
I noticed that my system was randomly crashing before reaching the desktop when signing in.
I'd enabled sunshine as a user service in systemd using systemctl --user enable sunshine.service
When first logging in, it looks like KWin and Sunshine both try to access /dev/dri/card1 at the same time. This causes a race condition and crashes KWin.
Is it possible to add functionality to wait until the system is ready, or avoid locking access to the GPU somehow?

Expected Behavior

No response

Additional Context

No response

Host Operating System

Linux

Operating System Version

Fedora 41 Kinoite

Architecture

amd64/x86_64

Sunshine commit or version

v2025.209.200029

Package

Linux - Fedora Copr

GPU Type

NVIDIA

GPU Model

4070 Ti

GPU Driver/Mesa Version

565.77

Capture Method

KMS (Linux)

Config

Apps

Relevant log output

KWin failing to access GPU:

kwin_wayland: No backend specified, automatically choosing drm
kwin_wayland: kwin_core: Failed to open /dev/dri/card1 device (Device or resource busy)
kwin_wayland: kwin_wayland_drm: failed to open drm device at "/dev/dri/card1"
kwin_wayland: kwin_wayland_drm: No suitable DRM devices have been found


Sunshine:

systemd Started sunshine.service - Sunshine self-hosted game stream host for Moonlight..
sunshine Info: Sunshine version: v2025.203.34856
sunshine Info: Package Publisher: LizardByte
sunshine Info: Publisher Website: https://app.lizardbyte.dev
sunshine Info: Get support: https://app.lizardbyte.dev/support
sunshine Error: Failed to create session:
sunshine Info: /dev/dri/card1 -> nvidia-drm
...
sunshine Warning: Failed to create system tray
sunshine Info: Screencasting with KMS
sunshine Error: Couldn't open: /dev/dri/card1: Permission denied
sunshine Error: Couldn't find monitor [0]
sunshine Error: Couldn't open: /dev/dri/card1: Permission denied
sunshine Error: Couldn't find monitor [0]
sunshine Info: Screencasting with KMS
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

No branches or pull requests

1 participant