Skip to content

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

Closed
ledif wants to merge 3 commits intoget-aurora-dev:mainfrom
ledif:nvidia-flatpak-sync
Closed

feat(nvidia): add service to sync Flatpak driver version#133
ledif wants to merge 3 commits intoget-aurora-dev:mainfrom
ledif:nvidia-flatpak-sync

Conversation

@ledif
Copy link
Copy Markdown

@ledif ledif commented Apr 1, 2026

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.


set -euo pipefail

SYSTEM_NVIDIA_VERSION=$(cat /proc/driver/nvidia/version | grep -oP 'Kernel Module\s+\K[0-9]+\.[0-9]+\.[0-9]+')
Copy link
Copy Markdown
Collaborator

@renner0e renner0e Apr 1, 2026

Choose a reason for hiding this comment

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

Sorry for the bikeshed but we can probably skip the cat here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Actually, this was broken. I had to change it to use head -1 instead and fix the regex.

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) 

But the grep was failing to match the version correctly:

❯ sudo bash -x /usr/local/bin/TEST-ublue-nvidia-flatpak-runtime-sync check
+ set -euo pipefail
++ grep -oP 'Kernel Module\s+\K[0-9]+\.[0-9]+\.[0-9]+' /proc/driver/nvidia/version
+ SYSTEM_NVIDIA_VERSION=

After updating the regex:

❯ 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

@renner0e
Copy link
Copy Markdown
Collaborator

renner0e commented Apr 1, 2026

I can't test this because I don't have the hardware but if it works we might want to put this in bluefin common

@ledif
Copy link
Copy Markdown
Author

ledif commented Apr 1, 2026

Closing in favor of projectbluefin/common#257.

@ledif ledif closed this Apr 1, 2026
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