Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit da523f5

Browse files
committed
feat: add nvidia
let's see if it works
1 parent 3688ff7 commit da523f5

File tree

12 files changed

+309
-2
lines changed

12 files changed

+309
-2
lines changed

.github/workflows/build-testing.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ jobs:
1818
packages: write
1919
id-token: write
2020
strategy:
21-
fail-fast: true
21+
fail-fast: false
2222
matrix:
2323
recipe:
2424
# !! Add your recipes here
2525
- recipe-deck-testing.yml
26+
- recipe-deck-nvidia-testing.yml
2627
- recipe-desktop-testing.yml
28+
- recipe-desktop-nvidia-testing.yml
2729
steps:
2830
# taken from secureblue, might speedup maximizing build disk space!
2931
# https://github.com/secureblue/secureblue/blob/aad24ddb05fe8b390919beb7f536d0b749f7244b/.github/workflows/build-one-recipe.yml#L44-L50

files/scripts/finalize-nvidia.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -ouex pipefail
4+
5+
KMOD_VERSION="$(rpm -q --queryformat '%{VERSION}' kmod-nvidia)"
6+
DRIVER_VERSION="$(rpm -q --queryformat '%{VERSION}' nvidia-driver)"
7+
if [ "$KMOD_VERSION" != "$DRIVER_VERSION" ]; then
8+
echo "Error: kmod-nvidia version ($KMOD_VERSION) does not match nvidia-driver version ($DRIVER_VERSION)"
9+
exit 1
10+
fi
11+
12+
dnf5 config-manager setopt fedora-nvidia.enabled=0 nvidia-container-toolkit.enabled=0
13+
sed -i 's/^MODULE_VARIANT=.*/MODULE_VARIANT=nvidia-open/' /etc/nvidia/kernel.conf
14+
semodule --verbose --install /usr/share/selinux/packages/nvidia-container.pp
15+
cp /etc/modprobe.d/nvidia-modeset.conf /usr/lib/modprobe.d/nvidia-modeset.conf
16+
sed -i 's@omit_drivers@force_drivers@g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf
17+
sed -i 's@ nvidia @ i915 amdgpu nvidia @g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf
18+
dnf5 config-manager setopt fedora-multimedia.enabled=1
19+
rm -f /usr/share/vulkan/icd.d/nouveau_icd.*.json
20+
ln -s libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so
21+
dnf5 config-manager setopt "terra-mesa".enabled=0

files/system_files/deck/usr/bin/cosmium-steam

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
DECK_OPTION=""
55

6+
export COSMIC_DISABLE_DIRECT_SCANOUT=1
7+
68
if [ ! -d $HOME/.local/share/Steam ]; then
79
# Set up steam with the bootstrap before starting it, this allows steam to run for the first time even with no network access
810
if [[ -f "/usr/share/gamescope-session-plus/bootstrap_steam.tar.gz" ]]; then
@@ -28,7 +30,7 @@ if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
2830
# It's been primarily developed for allowing the desktop functionality
2931
# on the Steam Controller to work while Steam is open on Wayland.
3032
# Also supports Steam Input as a whole.
31-
env LD_PRELOAD=/usr/lib/extest/libextest.so COSMIC_DISABLE_DIRECT_SCANOUT=1 /usr/bin/steam "$DECK_OPTION" "$@"
33+
env LD_PRELOAD=/usr/lib/extest/libextest.so /usr/bin/steam "$DECK_OPTION" "$@"
3234
else
3335
/usr/bin/steam "$DECK_OPTION" "$@"
3436
fi
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/bash
2+
# based on https://github.com/ublue-os/bazzite/blob/main/system_files/desktop/shared/usr/bin/bazzite-steam
3+
4+
DECK_OPTION=""
5+
6+
# Nvidia crash fix
7+
export __GL_CONSTANT_FRAME_RATE_HINT=3
8+
9+
export COSMIC_DISABLE_DIRECT_SCANOUT=1
10+
11+
if [ ! -d $HOME/.local/share/Steam ]; then
12+
# Set up steam with the bootstrap before starting it, this allows steam to run for the first time even with no network access
13+
if [[ -f "/usr/share/gamescope-session-plus/bootstrap_steam.tar.gz" ]]; then
14+
mkdir -p ~/.local/share/Steam
15+
tar xf /usr/share/gamescope-session-plus/bootstrap_steam.tar.gz -C ~/.local/share/Steam
16+
fi
17+
fi
18+
19+
# File toggle to override default Steam Deck flag behavior
20+
DECK_OVERRIDE_FLAG="$HOME/.config/cosmium/disable_steamdeck_flag"
21+
22+
# Required to maintain the Steam update branch between desktop & Steam Game Mode
23+
if [[ ! -f "$DECK_OVERRIDE_FLAG" ]]; then
24+
DECK_OPTION="-steamdeck"
25+
else
26+
DECK_OPTION=""
27+
fi
28+
29+
switcheroo_state="$(switcherooctl list)"
30+
31+
# If we're running this on a dGPU in a multi-gpu AMD/Intel system, apply a workaround for the blank Steam window bug
32+
if [[ $(echo "${switcheroo_state}" | grep -o 'Device:' | wc -l) -gt 1 ]]; then
33+
# TODO: Check if -system-composer is needed with nvidia >=555 driver
34+
if ! grep -Pq 'Name:\s+NVIDIA' <<< "$switcheroo_state"; then
35+
DGPU_OPTION="-system-composer"
36+
fi
37+
fi
38+
unset -v switcheroo_state
39+
40+
if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
41+
# https://github.com/Supreeeme/extest
42+
# Extest is a drop in replacement for the X11 XTEST extension.
43+
# It creates a virtual device with the uinput kernel module.
44+
# It's been primarily developed for allowing the desktop functionality
45+
# on the Steam Controller to work while Steam is open on Wayland.
46+
# Also supports Steam Input as a whole.
47+
env LD_PRELOAD=/usr/lib/extest/libextest.so /usr/bin/steam "$DECK_OPTION" "$@"
48+
else
49+
/usr/bin/steam "$DECK_OPTION" "$@"
50+
fi
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Add more distros and then use:
2+
# distrobox assemble create --replace --file /etc/distrobox/distrobox.ini --name containername
3+
# This will replace your distroboxes in place
4+
# Tip: Use additional_packages as declarative config!
5+
# See https://distrobox.privatedns.org/usage/distrobox-assemble/
6+
[arch]
7+
image=ghcr.io/ublue-os/arch-toolbox:latest
8+
nvidia=true
9+
pull=true
10+
11+
[bluefin-cli]
12+
image=ghcr.io/ublue-os/bluefin-cli
13+
nvidia=true
14+
pull=true
15+
16+
[debian]
17+
image=quay.io/toolbx-images/debian-toolbox:unstable
18+
nvidia=true
19+
pull=true
20+
21+
[fedora]
22+
image=ghcr.io/ublue-os/fedora-toolbox:latest
23+
nvidia=true
24+
pull=true
25+
26+
[opensuse]
27+
image=quay.io/toolbx-images/opensuse-toolbox:tumbleweed
28+
nvidia=true
29+
pull=true
30+
31+
[ubuntu]
32+
image=ghcr.io/ublue-os/ubuntu-toolbox:latest
33+
nvidia=true
34+
pull=true
35+
36+
[alma]
37+
image=quay.io/toolbx-images/almalinux-toolbox:latest
38+
nvidia=true
39+
pull=true
40+
41+
[centos]
42+
image=quay.io/toolbx-images/centos-toolbox:latest
43+
nvidia=true
44+
pull=true
45+
46+
[wolfi]
47+
image=ghcr.io/ublue-os/wolfi-toolbox
48+
nvidia=true
49+
pull=true
50+
51+
[wolfi-dx]
52+
image=ghcr.io/ublue-os/wolfi-dx-toolbox
53+
nvidia=true
54+
pull=true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/bash
2+
# based on https://github.com/ublue-os/bazzite/blob/main/system_files/desktop/shared/usr/bin/bazzite-steam
3+
4+
# Nvidia crash fix
5+
export __GL_CONSTANT_FRAME_RATE_HINT=3
6+
7+
export COSMIC_DISABLE_DIRECT_SCANOUT=1
8+
9+
switcheroo_state="$(switcherooctl list)"
10+
11+
# If we're running this on a dGPU in a multi-gpu AMD/Intel system, apply a workaround for the blank Steam window bug
12+
if [[ $(echo "${switcheroo_state}" | grep -o 'Device:' | wc -l) -gt 1 ]]; then
13+
# TODO: Check if -system-composer is needed with nvidia >=555 driver
14+
if ! grep -Pq 'Name:\s+NVIDIA' <<< "$switcheroo_state"; then
15+
DGPU_OPTION="-system-composer"
16+
fi
17+
fi
18+
unset -v switcheroo_state
19+
20+
if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
21+
# https://github.com/Supreeeme/extest
22+
# Extest is a drop in replacement for the X11 XTEST extension.
23+
# It creates a virtual device with the uinput kernel module.
24+
# It's been primarily developed for allowing the desktop functionality
25+
# on the Steam Controller to work while Steam is open on Wayland.
26+
# Also supports Steam Input as a whole.
27+
env LD_PRELOAD=/usr/lib/extest/libextest.so /usr/bin/steam "$@"
28+
else
29+
/usr/bin/steam "$@"
30+
fi
31+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/bash
2+
3+
# Licensed under the GNU General Public License v3.0
4+
# Script from CachyOS
5+
# This forces Nvidia DLSS to use the latest preset for SR, RR and framegen + updates the dlss dlls via ngx
6+
7+
export PROTON_ENABLE_NGX_UPDATER=1
8+
export DXVK_NVAPI_DRS_NGX_DLSS_RR_OVERRIDE=on
9+
export DXVK_NVAPI_DRS_NGX_DLSS_SR_OVERRIDE=on
10+
export DXVK_NVAPI_DRS_NGX_DLSS_FG_OVERRIDE=on
11+
export DXVK_NVAPI_DRS_NGX_DLSS_RR_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_latest
12+
export DXVK_NVAPI_DRS_NGX_DLSS_SR_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_latest
13+
14+
# applied variables, now execute the rest of the command
15+
exec "$@"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/bash
2+
3+
# Licensed under the GNU General Public License v3.0
4+
# Script from CachyOS
5+
# This forces Nvidia DLSS to use the latest preset for SR, RR and framegen + skips ngx updater
6+
7+
export DXVK_NVAPI_DRS_NGX_DLSS_RR_OVERRIDE=on
8+
export DXVK_NVAPI_DRS_NGX_DLSS_SR_OVERRIDE=on
9+
export DXVK_NVAPI_DRS_NGX_DLSS_FG_OVERRIDE=on
10+
export DXVK_NVAPI_DRS_NGX_DLSS_RR_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_latest
11+
export DXVK_NVAPI_DRS_NGX_DLSS_SR_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_latest
12+
13+
# applied variables, now execute the rest of the command
14+
exec "$@"

files/system_files/shared/usr/bin/cosmium-steam

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/bash
22
# based on https://github.com/ublue-os/bazzite/blob/main/system_files/desktop/shared/usr/bin/bazzite-steam
33

4+
export COSMIC_DISABLE_DIRECT_SCANOUT=1
5+
46
if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
57
# https://github.com/Supreeeme/extest
68
# Extest is a drop in replacement for the X11 XTEST extension.

recipes/common/nvidia.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
modules:
2+
- type: copy
3+
from: ghcr.io/ublue-os/akmods-nvidia-open:bazzite-42-x86_64
4+
src: /rpms
5+
dest: /tmp/akmods-nv-rpms
6+
7+
- type: script
8+
snippets:
9+
- "dnf5 config-manager setopt 'terra-mesa'.enabled=1"
10+
11+
- type: dnf
12+
install:
13+
packages:
14+
- egl-wayland.x86_64
15+
- egl-wayland.i686
16+
- egl-wayland2.x86_64
17+
- egl-wayland2.i686
18+
remove:
19+
packages:
20+
- nvidia-gpu-firmware
21+
- rocm-hip
22+
- rocm-opencl
23+
- rocm-clinfo
24+
- rocm-smi
25+
26+
- type: script
27+
snippets:
28+
- "find /tmp/akmods-nv-rpms/"
29+
- "dnf5 config-manager setopt fedora-cisco-openh264.enabled=0"
30+
- "dnf5 -y install /tmp/akmods-nv-rpms/ublue-os/ublue-os-nvidia-addons-*.rpm"
31+
32+
- type: dnf
33+
install:
34+
packages:
35+
- mesa-dri-drivers.i686
36+
- mesa-filesystem.i686
37+
- mesa-libEGL.i686
38+
- mesa-libGL.i686
39+
- mesa-libgbm.i686
40+
- mesa-va-drivers.i686
41+
- mesa-vulkan-drivers.i686
42+
43+
- type: script
44+
snippets:
45+
- "dnf5 config-manager setopt fedora-nvidia.enabled=1 nvidia-container-toolkit.enabled=1"
46+
- "dnf5 config-manager setopt fedora-multimedia.enabled=0"
47+
- "source /tmp/akmods-nv-rpms/kmods/nvidia-vars"
48+
49+
- type: dnf
50+
repos:
51+
cleanup: true
52+
copr:
53+
- ublue-os/staging
54+
install:
55+
packages:
56+
- libnvidia-fbc
57+
- libnvidia-ml.i686
58+
- libva-nvidia-driver
59+
- nvidia-driver
60+
- nvidia-driver-cuda
61+
- nvidia-driver-cuda-libs.i686
62+
- nvidia-driver-libs.i686
63+
- nvidia-settings
64+
- nvidia-container-toolkit
65+
66+
- type: script
67+
snippets:
68+
- "dnf5 -y install /tmp/akmods-nv-rpms/kmods/kmod-nvidia-*.rpm"
69+
70+
- type: script
71+
scripts:
72+
- finalize-nvidia.sh
73+
74+
- type: files
75+
files:
76+
- source: system_files/nvidia/shared
77+
destination: /

0 commit comments

Comments
 (0)