Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build_scripts/overrides/nvidia/20-nvidia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ EOF
dnf config-manager --set-disabled nvidia-container-toolkit

systemctl enable ublue-nvctk-cdi.service
systemctl enable ublue-nvidia-flatpak-runtime-sync.service
semodule --verbose --install /usr/share/selinux/packages/nvidia-container.pp

# Universal Blue specific Initramfs fixes
Expand Down
11 changes: 11 additions & 0 deletions docs/skills/hardware/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ The `bluefin-lts-nvidia` variant ships full CDI configuration so `podman run --d

### NVIDIA CDI wiring

**Shared NVIDIA files evaluated for LTS**

| Shared file | LTS decision | Reason |
|---|---|---|
| `ublue-nvidia-flatpak-runtime-sync.service` | Included | CentOS Stream LTS ships Flatpak and systemd; the service is gated on the NVIDIA module and bootc runtime. |
| `ublue-nvidia-flatpak-runtime-sync` | Included | Uses the standard Flatpak CLI and NVIDIA module version file; no Fedora-specific paths or package-manager assumptions. |

The service and helper are copied into the LTS NVIDIA overlay and the service is
explicitly enabled by `20-nvidia.sh`. Other shared NVIDIA files are not present
in the current common layer and are not copied speculatively.

**`build_scripts/overrides/nvidia/20-nvidia.sh`**
```bash
# Configure nvidia-container-toolkit for rootless use.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Unit]
Description=Sync NVIDIA system drivers with Flatpak runtime and update system Flatpaks
After=network-online.target flatpak-system-helper.service
Wants=network-online.target
ConditionPathExists=/sys/module/nvidia/version
# To not run on live ISO
ConditionPathExists=/run/ostree-booted

[Service]
Type=oneshot
ExecCondition=/usr/libexec/ublue-nvidia-flatpak-runtime-sync check
ExecStart=/usr/libexec/ublue-nvidia-flatpak-runtime-sync sync
RemainAfterExit=yes
Restart=on-failure
RestartSec=30
TimeoutStartSec=900

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/bash

# Workaround for: https://github.com/flatpak/flatpak/issues/3907
set -euo pipefail

# NVIDIA_VERSION_FILE: override in tests to avoid reading real /sys
NVIDIA_VERSION_FILE="${NVIDIA_VERSION_FILE:-/sys/module/nvidia/version}"

SYSTEM_NVIDIA_VERSION=$(cat "${NVIDIA_VERSION_FILE}")
FLATPAK_NVIDIA_VERSION=$(echo "${SYSTEM_NVIDIA_VERSION}" | tr '.' '-')

case "${1:-}" in
check)
# Exit 0 if sync is needed (versions mismatch), exit 1 if already in sync
if flatpak info --system org.freedesktop.Platform.GL.nvidia-"${FLATPAK_NVIDIA_VERSION}" >/dev/null 2>&1 && \
flatpak info --system org.freedesktop.Platform.GL32.nvidia-"${FLATPAK_NVIDIA_VERSION}" >/dev/null 2>&1; then
echo "NVIDIA Flatpak runtime ${SYSTEM_NVIDIA_VERSION} already installed"
exit 1
fi
echo "NVIDIA Flatpak runtime ${SYSTEM_NVIDIA_VERSION} needs to be installed"
exit 0
;;
sync)
echo "Installing NVIDIA Flatpak runtime version ${SYSTEM_NVIDIA_VERSION}"
flatpak remote-add --system --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --system --noninteractive -y flathub \
org.freedesktop.Platform.GL.nvidia-"${FLATPAK_NVIDIA_VERSION}" \
org.freedesktop.Platform.GL32.nvidia-"${FLATPAK_NVIDIA_VERSION}"
echo "Updating system Flatpaks after NVIDIA driver change"
flatpak update --system --noninteractive -y
;;
*)
echo "Usage: $0 {check|sync}"
exit 1
;;
esac