Skip to content

feat(nvidia): add service to sync Flatpak driver version#257

Merged
renner0e merged 6 commits intoprojectbluefin:mainfrom
ledif:nvidia-flatpak-sync
Apr 2, 2026
Merged

feat(nvidia): add service to sync Flatpak driver version#257
renner0e merged 6 commits intoprojectbluefin:mainfrom
ledif:nvidia-flatpak-sync

Conversation

@ledif
Copy link
Copy Markdown
Contributor

@ledif ledif commented Apr 1, 2026

Supersedes get-aurora-dev/common#133.

Tested it on my Bazzite machine which has an NVIDIA card.

○ ublue-nvidia-flatpak-runtime-sync.service - Sync NVIDIA system drivers with Flatpak runtime
     Loaded: loaded (/etc/systemd/system/ublue-nvidia-flatpak-runtime-sync.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead) (Result: exec-condition) since Wed 2026-04-01 09:16:00 CDT; 1s ago
 Invocation: dedef8b0919a46bca0c115e0bf7a1ae3
  Condition: start condition unmet at Wed 2026-04-01 09:16:00 CDT; 1s ago
    Process: 4341 ExecCondition=/usr/local/bin/TEST-ublue-nvidia-flatpak-runtime-sync check (code=exited, status=1/FAILURE)
   Mem peak: 1.6M
        CPU: 5ms

Apr 01 09:16:00 llano systemd[1]: Starting ublue-nvidia-flatpak-runtime-sync.service - Sync NVIDIA system drivers with Flatpak runtime...
Apr 01 09:16:00 llano systemd[1]: ublue-nvidia-flatpak-runtime-sync.service: Skipped due to 'exec-condition'.
Apr 01 09:16:00 llano systemd[1]: Condition check resulted in ublue-nvidia-flatpak-runtime-sync.service - Sync NVIDIA system drivers with Flatpak runtime being skipped.

It exited because the Flatpak platform was already in sync with the on image driver version, but it seems like it should work when they are not synced.

This is what the driver reports:

❯ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  595.58.03  Release Build  (builder@dbdfa680a27e)  Wed Mar 25 09:03:45 UTC 2026
GCC version:  gcc version 15.2.1 20260123 (Red Hat 15.2.1-7) (GCC) 

This is executing the script with -x:

❯ sudo bash -x /usr/local/bin/TEST-ublue-nvidia-flatpak-runtime-sync check
+ set -euo pipefail
++ head -1 /proc/driver/nvidia/version
++ grep -oP '\d+\.\d+\.\d+'
+ SYSTEM_NVIDIA_VERSION=595.58.03
++ echo 595.58.03
++ tr . -
+ FLATPAK_NVIDIA_VERSION=595-58-03
+ case "${1}" in
+ flatpak info --system org.freedesktop.Platform.GL.nvidia-595-58-03
+ flatpak info --system org.freedesktop.Platform.GL32.nvidia-595-58-03
+ echo 'NVIDIA Flatpak runtime 595.58.03 already installed'
NVIDIA Flatpak runtime 595.58.03 already installed
+ exit 1

fixes: ublue-os/aurora#1418

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 1, 2026
@dosubot dosubot bot added area/services System Services and Management kind/enhancement New feature, don't implement without a spec and consensus labels Apr 1, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a systemd service and a helper script to synchronize NVIDIA system drivers with Flatpak runtimes. The feedback highlights the need for a more robust version detection regex, explicit system-wide installation flags for Flatpak, and the addition of retry logic and timeout extensions in the systemd service to better handle network-dependent tasks.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@renner0e renner0e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find them annoying to deal with but we should probably also check this for --user flatpaks, would be nice if we could reuse this script here for those as well, but it's a little more tricky to figure that out.

@ledif
Copy link
Copy Markdown
Contributor Author

ledif commented Apr 1, 2026

I find them annoying to deal with but we should probably also check this for --user flatpaks, would be nice if we could reuse this script here for those as well, but it's a little more tricky to figure that out.

I agree we should tackle user Flatpaks at some point, but let's stick to just the system ones for this PR.

@renner0e
Copy link
Copy Markdown
Contributor

renner0e commented Apr 1, 2026

Related upstream issue: flatpak/flatpak#3907

ledif and others added 2 commits April 1, 2026 21:16
Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 2, 2026
@renner0e
Copy link
Copy Markdown
Contributor

renner0e commented Apr 2, 2026

Good stuff

@renner0e renner0e added this pull request to the merge queue Apr 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 2, 2026
@renner0e renner0e added this pull request to the merge queue Apr 2, 2026
Merged via the queue into projectbluefin:main with commit 58f98da Apr 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/services System Services and Management kind/enhancement New feature, don't implement without a spec and consensus lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve experience with syncing NVIDIA drivers and Flatpak runtime versions

3 participants