Skip to content

nixos/kmscon: Fix session & gpu clashing #391574

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hustlerone
Copy link
Contributor

@hustlerone hustlerone commented Mar 20, 2025

Things done

Adjusted the systemd unit for kmscon to fix #385497

This however will completely disable DRM for kmscon and now seats will be unspecified.
If someone absolutely requires DRM for kmscon, let me know.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Mar 20, 2025
@hustlerone hustlerone marked this pull request as draft March 20, 2025 14:25
@hustlerone
Copy link
Contributor Author

As per fbcon fashion, there's rendering issues. I guess the PR will get much more complicated if this doesn't turn out to be a fluke.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Mar 20, 2025
@hustlerone hustlerone marked this pull request as ready for review March 20, 2025 14:31
@hustlerone
Copy link
Contributor Author

Ok, this might just be a greetd issue I'm having.

Either way, it would be great if someone would test this under "normal" circumstances

@liff
Copy link
Contributor

liff commented Mar 21, 2025

Enabled with GNOME and it seems to work like it used to. Didn’t test extensively, but at least GDM is able to start now.

@hustlerone
Copy link
Contributor Author

Yeah, I suspect the current rev we're in actually works as intended and we actually have to disable DRM specifically.

There also is the option to patch kmscon to allow it to free the gpu on demand. However, we would also have to modify every single derivation that starts a graphical session or needs /dev/dri/cardX so it also tells kmscon to free the GPU, just so we use DRM for kmscon (and I don't know any benefits of using DRM over fbcon for kmscon)

@hustlerone hustlerone requested review from omasanori and nbraud March 22, 2025 11:52
@github-actions github-actions bot removed 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Mar 30, 2025
@hustlerone
Copy link
Contributor Author

how do i undo this git has played me

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 10.rebuild-linux: 1-10 and removed 10.rebuild-linux: 1-10 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Mar 30, 2025
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5352

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5372

@SuperSandro2000
Copy link
Member

I couldn't use kmscon for a while because it broke SDDM and with this patch I found 2 issues immediately:

  • performance is pretty poor
  • different TTYs do not work correctly. eg when opening vim on 1 it also displays at 3 but also the login prompt at the same time

@hustlerone
Copy link
Contributor Author

Maybe that's why specifying a seat is necessary? Try specifying a seat as an extra argument.

There is a bandaid fix so kmscon can free the GPU but that would require wrapping every single binary that will have to access the GPU (wrap Plasma, GNOME, Sway, Hyprland, etc.). Even then performance isn't guaranteed.

@SuperSandro2000
Copy link
Member

Yeah, we cannot wrap every other binary. There must be another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nixos/kmscon: prevents entering the desktop environment
4 participants