Compare commits

...
Author SHA1 Message Date
theupriserandClaude Sonnet 5.5 2811ecce1c feat: on a supported NVIDIA card the SteamOS conversion replaces Gaming on NVIDIA
Sync git.upriser.nl mirror / sync (push) Skipped
The conversion also sets up what Gaming on NVIDIA did there (kernel parameters, early modules, suspend memory, 32-bit libraries). Gaming on NVIDIA is only offered on older NVIDIA cards, or while it is on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkpbsMw4rQyBsxDG6ebHK2
2026-10-13 18:24:54 +02:00
theupriserandClaude Sonnet 5.5 515019770f fix: on NVIDIA the SteamOS conversion is a choice, Gaming on NVIDIA stays preselected; supported cards are GTX 16 / RTX 20 and newer
Sync git.upriser.nl mirror / sync (push) Skipped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkpbsMw4rQyBsxDG6ebHK2
2026-10-13 18:19:21 +02:00
theupriserandClaude Sonnet 5.5 0ba94b23d8 docs: NVIDIA section of TECHNICAL.md follows the patched gamescope
Sync git.upriser.nl mirror / sync (push) Skipped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkpbsMw4rQyBsxDG6ebHK2
2026-10-13 18:18:27 +02:00
theupriserandClaude Sonnet 5.5 127b8cf88b feat: SteamOS conversion on NVIDIA with a patched gamescope (GBM scan-out)
Sync git.upriser.nl mirror / sync (push) Skipped
The conversion is offered on supported NVIDIA cards again; it builds and installs steamify-gamescope-nvidia and sets gamescope_drm_gbm_scanout=1. It and Gaming on NVIDIA exclude each other.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkpbsMw4rQyBsxDG6ebHK2
2026-10-13 18:18:09 +02:00
theupriserandClaude Sonnet 5.5 4d60dd227d chore: keep the gamescope GBM scan-out patch (NVIDIA picture fix) in patches/
Sync git.upriser.nl mirror / sync (push) Skipped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkpbsMw4rQyBsxDG6ebHK2
2026-10-13 18:05:01 +02:00
theupriserandClaude Sonnet 5.5 ce4bc67e8c feat: Gaming on NVIDIA keeps video memory over suspend and installs the 32-bit libraries
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 15:23:21 +02:00
11 changed files with 1230 additions and 21 deletions

No files matched your search

+6
View File
@@ -5,6 +5,12 @@ All notable changes, per version and per commit. Versions follow
`steamify.sh`. Versions before 0.7.0 were numbered afterwards, `steamify.sh`. Versions before 0.7.0 were numbered afterwards,
one per merged pull request. one per merged pull request.
## 2.11.2 - 2026-10-13
- **feat: the SteamOS conversion is offered on NVIDIA PCs again (GTX 16 / RTX 20 series or newer: Turing and later, the cards NVIDIA's open kernel driver supports): it builds and installs a patched gamescope from [steamify-gamescope-nvidia](https://github.com/theupriser/steamify-gamescope-nvidia) (GBM-allocated scan-out buffers, NVIDIA's corrupted gaming-mode picture, gamescope#2309; a few minutes to build) and sets `gamescope_drm_gbm_scanout=1` for the session (`lib/gamescope-nvidia.sh`). On those cards it replaces "Gaming on NVIDIA" (kernel parameters, early modules, suspend memory and the 32-bit libraries come with it); "Gaming on NVIDIA" is only offered on older NVIDIA cards, or while it is on (turn it off or swap it for the conversion; the two exclude each other); single user mode works with either. Tested on an RTX 5080 (driver 615.78.08): Steam's gaming UI is clean with it and shows artifacts without. The package is pinned to one gamescope release: updating it is not automatic yet**
- **feat: "Gaming on NVIDIA" also keeps video memory over suspend (`NVreg_PreserveVideoMemoryAllocations=1` in `/etc/modprobe.d/90-steamify-nvidia.conf`, the initramfs is rebuilt), enables `nvidia-suspend`/`nvidia-resume`/`nvidia-hibernate`, and installs `lib32-nvidia-utils` and `lib32-libxkbcommon` (32-bit games, the 32-bit MangoHud preload) on a supported card; off removes only what Steamify added. Untested on hardware yet**
## 2.11.1 - 2026-10-02 ## 2.11.1 - 2026-10-02
- `d70aeb8` **docs: new README screenshots of the app (2.11 menu) on a Steam Machine and on an NVIDIA PC, and the README names the opt-in "Start Steam silently in desktop mode" and the icons as an option of the conversion** - `d70aeb8` **docs: new README screenshots of the app (2.11 menu) on a Steam Machine and on an NVIDIA PC, and the README names the opt-in "Start Steam silently in desktop mode" and the icons as an option of the conversion**
+19 -3
View File
@@ -238,10 +238,25 @@ no fix known). The kernel parameters `nvidia-drm.modeset=1`/`fbdev=1` and loadin
window straight to the display. What does work on an RTX 5080: Steam's Big Picture (`steam -gamepadui`) as a normal window of window straight to the display. What does work on an RTX 5080: Steam's Big Picture (`steam -gamepadui`) as a normal window of
the Plasma desktop session, smooth and clean. the Plasma desktop session, smooth and clean.
Since 2.11.2 there is a second way: gamescope with GBM-allocated scan-out buffers (`lib/gamescope-nvidia.sh`). On an RTX 5080
(driver 615.78.08, 3440x1440@175) Steam's gaming UI in gamescope's DRM session is clean with it and shows artifacts everywhere
without. The patch is nine commits of [farnoy/gamescope](https://github.com/farnoy/gamescope) (`nvidia-gbm-wayland`), kept in
[steamify-gamescope-nvidia](https://github.com/theupriser/steamify-gamescope-nvidia) with its PKGBUILD; `gsn_install_package` clones
that repository, builds the package as the user (`makepkg -sf`) and installs it with `pacman -U --ask 4` (the package provides and
conflicts with `gamescope`). It is opt-in inside gamescope: `gamescope_drm_gbm_scanout=1` in
`~/.config/gamescope-session/environment` and `~/.config/environment.d/99-steamify-gamescope-nvidia.conf`. The SteamOS conversion
(`gaming_enable`) does this on a supported card (`nvidia_supported`), together with what "Gaming on NVIDIA" sets up there (the kernel
parameters, the early modules, suspend memory, the 32-bit libraries: `nvidia_kernel_enable`, `nvidia_extras_enable`). So on a
supported card the conversion replaces "Gaming on NVIDIA": that one is only offered on older NVIDIA cards, or while it is already on
(to turn it off, or swap it for the conversion; the two exclude each other: `toggle_component`, `backend.sh`, `AppState.qml`).
Single user mode works with either. Turning the conversion off removes the setting and those settings, and keeps the packages. The package is pinned to the gamescope release the patch was made for
(`UPSTREAM_VERSION` in that repository): pacman does not update it, and Steamify does not rebuild it yet.
So with an NVIDIA GPU (PCI vendor 0x10de, display class, its driver providing `nvidia_drm`: `nvidia_present`) the SteamOS So with an NVIDIA GPU (PCI vendor 0x10de, display class, its driver providing `nvidia_drm`: `nvidia_present`) the SteamOS
conversion (`gaming`, and its options `boot`, `single`, `glyphs`) isn't offered, unless it is already on (so it can be turned conversion (`gaming`, and its options `boot`, `single`, `glyphs`) is only offered on a supported card (GTX 16 / RTX 20 series or newer, Turing and later,
off). `nvidia` ("Gaming on NVIDIA", `lib/nvidia.sh`) takes its place, hidden while the conversion is on (both would start `nvidia_supported`) with the patched gamescope described below, or when it is already on (so it can be turned off).
Steam at login): it installs `steam` when missing (recorded in state `nvidia`, removed again only then) and enables the user `nvidia` ("Gaming on NVIDIA", `lib/nvidia.sh`) is for older NVIDIA cards (and for PCs where it is already on), and excludes the
conversion (both would start Steam at login): it installs `steam` when missing (recorded in state `nvidia`, removed again only then) and enables the user
unit `steamify-steam-autostart.service` (`services/`, `ExecStart=/usr/bin/steam @ARGS@`, Plasma only). Its sub-option unit `steamify-steam-autostart.service` (`services/`, `ExecStart=/usr/bin/steam @ARGS@`, Plasma only). Its sub-option
`bigpicture` ("Steam starts in Big Picture", ticked along with it) rewrites the unit with `-gamepadui` and sets `bigpicture` ("Steam starts in Big Picture", ticked along with it) rewrites the unit with `-gamepadui` and sets
`ksmserverrc [General] loginMode=emptySession` (`kset`, undone with `krevert bigpicture`), so windows of the last session `ksmserverrc [General] loginMode=emptySession` (`kset`, undone with `krevert bigpicture`), so windows of the last session
@@ -572,6 +587,7 @@ immediately, which can turn into a loop - see
| `lib/update-notifier.sh` | Update notifications: the notifier from `patches/` and its user timer | | `lib/update-notifier.sh` | Update notifications: the notifier from `patches/` and its user timer |
| `lib/first-login.sh` | `--defaults` without a session (the Steam Machine ISO's installer): the one-time first-login step that sets up single user's launcher on Plasma's new layout and opens the app | | `lib/first-login.sh` | `--defaults` without a session (the Steam Machine ISO's installer): the one-time first-login step that sets up single user's launcher on Plasma's new layout and opens the app |
| `lib/controllers.sh` | Extended controller support: Xbox wireless dongle (xone) and Xbox Bluetooth (xpadneo) from the CachyOS repo | | `lib/controllers.sh` | Extended controller support: Xbox wireless dongle (xone) and Xbox Bluetooth (xpadneo) from the CachyOS repo |
| `lib/gamescope-nvidia.sh` | gamescope on NVIDIA: builds and installs the patched gamescope (GBM scan-out) from steamify-gamescope-nvidia and sets `gamescope_drm_gbm_scanout=1` for the SteamOS conversion |
| `lib/nvidia.sh` | Gaming on NVIDIA: Steam on the desktop, started at login, optionally in Big Picture (replaces the SteamOS conversion there) | | `lib/nvidia.sh` | Gaming on NVIDIA: Steam on the desktop, started at login, optionally in Big Picture (replaces the SteamOS conversion there) |
| `lib/vram-booster.sh` | VRAM booster (`dmemcg-booster`, `plasma-foreground-booster`) | | `lib/vram-booster.sh` | VRAM booster (`dmemcg-booster`, `plasma-foreground-booster`) |
| `services/` | The systemd units the scripts install (`service_file`, `@KEY@` placeholders); see its README | | `services/` | The systemd units the scripts install (`service_file`, `@KEY@` placeholders); see its README |
+8 -3
View File
@@ -147,10 +147,15 @@ backend_apply() {
for id in "${want[@]}"; do [[ "$id" == "$c" ]] && WANTED[$c]=1; done for id in "${want[@]}"; do [[ "$id" == "$c" ]] && WANTED[$c]=1; done
done done
# The same rules as the menu's toggles. # The same rules as the menu's toggles.
# (Single user mode only needs the conversion where it is offered: not on NVIDIA PCs.) # (Single user mode only needs the conversion where it is offered: not on NVIDIA PCs, where it works without it.)
[[ "${WANTED[single]:-0}" == 1 ]] && component_available gaming && WANTED[gaming]=1 [[ "${WANTED[single]:-0}" == 1 ]] && component_available gaming && ! nvidia_present && WANTED[gaming]=1
# On NVIDIA the conversion and "Gaming on NVIDIA" exclude each other: the one that is not on yet wins.
if nvidia_present && [[ "${WANTED[gaming]:-0}" == 1 && "${WANTED[nvidia]:-0}" == 1 ]]; then
if [[ "${CURRENT[gaming]:-0}" == 1 ]]; then WANTED[gaming]=0; WANTED[boot]=0; WANTED[silent]=0; WANTED[glyphs]=0
else WANTED[nvidia]=0; WANTED[bigpicture]=0; WANTED[nvsilent]=0; fi
fi
if component_available gaming; then if component_available gaming; then
[[ "${WANTED[gaming]:-0}" == 0 ]] && { WANTED[single]=0; WANTED[boot]=0; } [[ "${WANTED[gaming]:-0}" == 0 ]] && { nvidia_present || WANTED[single]=0; WANTED[boot]=0; }
else else
WANTED[boot]=0 WANTED[boot]=0
fi fi
+80
View File
@@ -0,0 +1,80 @@
#!/bin/bash
# gamescope's own gaming mode on NVIDIA: a patched gamescope that allocates its scan-out buffers with GBM, which cures
# the corrupted picture (https://github.com/ValveSoftware/gamescope/issues/2309). The patch and the build recipe live in
# https://github.com/theupriser/steamify-gamescope-nvidia; the package `steamify-gamescope-nvidia` is built here, on the PC,
# and replaces `gamescope` (it provides it). The patch is opt-in: gamescope reads `gamescope_drm_gbm_scanout=1` from its
# environment, which is set for the gaming session (gamescope-session's environment file, and environment.d).
# Used by the SteamOS conversion (`gaming_enable`/`gaming_disable`) on a supported NVIDIA card (`nvidia_supported`):
# GTX 16 / RTX 20 series or newer (Turing and later, what NVIDIA's open kernel driver supports).
# Sourced by steamify.sh; not meant to be run on its own.
GSN_PKG=steamify-gamescope-nvidia
GSN_REPO=${GSN_REPO:-https://github.com/theupriser/steamify-gamescope-nvidia.git}
GSN_ENV_LINE='gamescope_drm_gbm_scanout=1'
GSN_ENV_D="${GSN_ENV_D:-$HOME/.config/environment.d/99-steamify-gamescope-nvidia.conf}"
GSN_SESSION_ENV="${GSN_SESSION_ENV:-$HOME/.config/gamescope-session/environment}"
gsn_package_installed() { pacman -Q "$GSN_PKG" >/dev/null 2>&1; }
gsn_env_set() { [[ -f "$GSN_ENV_D" ]] && grep -qsx "$GSN_ENV_LINE" "$GSN_SESSION_ENV"; }
gsn_status() { gsn_package_installed && gsn_env_set; }
gsn_install_package() {
# Builds the package from the repo (makepkg runs as the user, never as root) and installs it. The build needs a few
# minutes: gamescope compiles from source. --ask 4 lets pacman replace the stock gamescope it conflicts with.
gsn_package_installed && return 0
info "Building the patched gamescope for NVIDIA (a few minutes)..."
sudo pacman -S --needed --noconfirm base-devel git || { err "Installing the build tools failed."; return 1; }
local dir pkg
dir="$(mktemp -d)" || return 1
if ! git clone --depth 1 "$GSN_REPO" "$dir/src"; then
err "Couldn't download $GSN_REPO."
rm -rf "$dir"; return 1
fi
if ! (cd "$dir/src" && makepkg -sf --noconfirm --nocheck); then
err "Building the patched gamescope failed (see above). The stock gamescope stays."
rm -rf "$dir"; return 1
fi
pkg="$(ls "$dir"/src/"$GSN_PKG"-*.pkg.tar.* 2>/dev/null | grep -v -- '-debug-' | head -1)"
if [[ -z "$pkg" ]] || ! sudo pacman -U --noconfirm --ask 4 "$pkg"; then
err "Installing the patched gamescope failed. The stock gamescope stays."
rm -rf "$dir"; return 1
fi
rm -rf "$dir"
ok "Patched gamescope installed."
}
gsn_env_enable() {
mkdir -p "$(dirname "$GSN_ENV_D")" "$(dirname "$GSN_SESSION_ENV")"
echo "$GSN_ENV_LINE" > "$GSN_ENV_D"
touch "$GSN_SESSION_ENV"
grep -qsx "$GSN_ENV_LINE" "$GSN_SESSION_ENV" || echo "$GSN_ENV_LINE" >> "$GSN_SESSION_ENV"
}
gsn_env_disable() {
rm -f "$GSN_ENV_D"
[[ -f "$GSN_SESSION_ENV" ]] && sed -i "/^${GSN_ENV_LINE}\$/d" "$GSN_SESSION_ENV"
return 0
}
gsn_enable() {
# Only on a supported NVIDIA card; elsewhere the stock gamescope is right.
nvidia_supported || return 0
# What NVIDIA's DRM stack wants (lib/nvidia.sh): modeset/fbdev on the kernel command line, the modules in the
# initramfs, video memory kept over suspend, the 32-bit libraries. Takes effect at the next boot, like the session.
nvidia_kernel_enable || return 1
nvidia_extras_enable || return 1
gsn_install_package || return 1
gsn_env_enable
ok "gamescope draws NVIDIA's picture through GBM (gamescope_drm_gbm_scanout=1) from the next gaming mode start."
}
gsn_disable() {
# The setting goes, and what nvidia_*_enable added; the packages stay (patched gamescope, 32-bit libraries), like
# the other packages of the conversion (steam, gamescope-session-cachyos).
gsn_env_disable
nvidia_supported || return 0
nvidia_extras_disable
nvidia_kernel_disable
}
+3
View File
@@ -94,6 +94,8 @@ gaming_enable() {
# LOGIN_MANAGER (sddm with single user, else plasmalogin) is set by the # LOGIN_MANAGER (sddm with single user, else plasmalogin) is set by the
# menu. Re-running with the other value switches over cleanly. # menu. Re-running with the other value switches over cleanly.
install_required_packages || return 1 install_required_packages || return 1
# NVIDIA: gamescope's picture is corrupted unless it is the patched one (no-op elsewhere).
gsn_enable || return 1
case "$LOGIN_MANAGER" in case "$LOGIN_MANAGER" in
sddm) sddm)
switch_to_sddm || return 1 switch_to_sddm || return 1
@@ -122,6 +124,7 @@ gaming_disable() {
switch_to_plasmalogin switch_to_plasmalogin
remove_desktop_shortcut remove_desktop_shortcut
steam_disable steam_disable
gsn_disable
krevert gaming krevert gaming
os_name_disable os_name_disable
ok "The PC boots to the normal login screen again (from the next boot)." ok "The PC boots to the normal login screen again (from the next boot)."
+16 -6
View File
@@ -26,7 +26,7 @@ NO_PRESELECT=(boot silent nvsilent cec kpin hdmi extended_controller_support)
# FEATURE_BASELINE. # FEATURE_BASELINE.
FEATURE_BASELINE=2.1.0 FEATURE_BASELINE=2.1.0
declare -A FEATURE_VERSION=( declare -A FEATURE_VERSION=(
[gaming]=2.9.0 [boot]=2.1.0 [silent]=2.11.0 [nvidia]=2.10.0 [bigpicture]=2.10.0 [nvsilent]=2.11.0 [theme]=2.1.0 [glyphs]=2.1.0 [single]=2.1.0 [gaming]=2.9.0 [boot]=2.1.0 [silent]=2.11.0 [nvidia]=2.11.2 [bigpicture]=2.10.0 [nvsilent]=2.11.0 [theme]=2.1.0 [glyphs]=2.1.0 [single]=2.1.0
[launcher]=2.1.0 [cec]=2.7.0 [machine]=2.9.0 [poweroff]=2.2.0 [vram]=2.3.0 [notify]=2.5.0 [steamgame]=2.5.1 [extended_controller_support]=2.10.0 [launcher]=2.1.0 [cec]=2.7.0 [machine]=2.9.0 [poweroff]=2.2.0 [vram]=2.3.0 [notify]=2.5.0 [steamgame]=2.5.1 [extended_controller_support]=2.10.0
[kpin]=2.1.0 [hdmi]=2.1.0 [kpin]=2.1.0 [hdmi]=2.1.0
) )
@@ -57,9 +57,10 @@ declare -A CURRENT WANTED
component_available() { component_available() {
case "$1" in case "$1" in
# gamescope's own session is broken on NVIDIA: the conversion is replaced by "Gaming on NVIDIA" there (shown # gamescope's own session shows a corrupted picture on NVIDIA unless it is the patched one (lib/gamescope-nvidia.sh,
# anyway when it's already on, so it can be turned off). # installed with the conversion on a supported card); "Gaming on NVIDIA" is the alternative there. Older NVIDIA
gaming|boot|silent|glyphs) ! nvidia_present || gaming_status ;; # cards only get the alternative (the conversion is shown anyway when it's already on, so it can be turned off).
gaming|boot|silent|glyphs) ! nvidia_present || gaming_status || nvidia_supported ;;
nvidia) nvidia_available ;; nvidia) nvidia_available ;;
bigpicture|nvsilent) bigpicture_available ;; bigpicture|nvsilent) bigpicture_available ;;
machine|poweroff) machine_available ;; machine|poweroff) machine_available ;;
@@ -297,8 +298,8 @@ toggle_component() {
WANTED[$c]=$(( 1 - WANTED[$c] )) WANTED[$c]=$(( 1 - WANTED[$c] ))
# Single user mode only makes sense on top of the SteamOS conversion. # Single user mode only makes sense on top of the SteamOS conversion.
# (On NVIDIA the conversion isn't offered: single user mode logs in by itself, see lib/single-user.sh.) # (On NVIDIA the conversion isn't offered: single user mode logs in by itself, see lib/single-user.sh.)
if [[ "$c" == single && "${WANTED[single]}" == 1 ]] && component_available gaming; then WANTED[gaming]=1; fi if [[ "$c" == single && "${WANTED[single]}" == 1 ]] && component_available gaming && ! nvidia_present; then WANTED[gaming]=1; fi
if [[ "$c" == gaming && "${WANTED[gaming]}" == 0 ]]; then WANTED[single]=0; WANTED[boot]=0; fi if [[ "$c" == gaming && "${WANTED[gaming]}" == 0 ]]; then nvidia_present || WANTED[single]=0; WANTED[boot]=0; fi
# Where to boot to is part of the conversion, too. # Where to boot to is part of the conversion, too.
if [[ "$c" == boot && "${WANTED[boot]}" == 1 ]]; then WANTED[gaming]=1; fi if [[ "$c" == boot && "${WANTED[boot]}" == 1 ]]; then WANTED[gaming]=1; fi
# Big Picture is opt-out: ticked along with "Gaming on NVIDIA". # Big Picture is opt-out: ticked along with "Gaming on NVIDIA".
@@ -310,6 +311,15 @@ toggle_component() {
if [[ "$c" == gaming && "${WANTED[gaming]}" == 0 ]]; then WANTED[silent]=0; WANTED[glyphs]=0; fi if [[ "$c" == gaming && "${WANTED[gaming]}" == 0 ]]; then WANTED[silent]=0; WANTED[glyphs]=0; fi
if [[ "$c" == silent && "${WANTED[silent]}" == 1 ]]; then WANTED[gaming]=1; fi if [[ "$c" == silent && "${WANTED[silent]}" == 1 ]]; then WANTED[gaming]=1; fi
if [[ "$c" == glyphs && "${WANTED[glyphs]}" == 1 ]]; then WANTED[gaming]=1; fi if [[ "$c" == glyphs && "${WANTED[glyphs]}" == 1 ]]; then WANTED[gaming]=1; fi
# On NVIDIA the SteamOS conversion and "Gaming on NVIDIA" exclude each other (both would start Steam at login);
# single user mode works with either.
if nvidia_present; then
if [[ "$c" == nvidia && "${WANTED[nvidia]}" == 1 ]]; then
WANTED[gaming]=0; WANTED[boot]=0; WANTED[silent]=0; WANTED[glyphs]=0
elif [[ "$c" =~ ^(gaming|boot|silent|glyphs)$ && "${WANTED[$c]}" == 1 && "${WANTED[gaming]}" == 1 ]]; then
WANTED[nvidia]=0; WANTED[bigpicture]=0; WANTED[nvsilent]=0
fi
fi
# The power-off fix is opt-out: ticked along with Steam Machine support. # The power-off fix is opt-out: ticked along with Steam Machine support.
if [[ "$c" == machine ]]; then WANTED[poweroff]=${WANTED[machine]}; fi if [[ "$c" == machine ]]; then WANTED[poweroff]=${WANTED[machine]}; fi
if [[ "$c" == poweroff && "${WANTED[poweroff]}" == 1 ]]; then WANTED[machine]=1; fi if [[ "$c" == poweroff && "${WANTED[poweroff]}" == 1 ]]; then WANTED[machine]=1; fi
+61 -5
View File
@@ -13,6 +13,11 @@ NVIDIA_INITRAMFS_CONF=${NVIDIA_INITRAMFS_CONF:-/etc/mkinitcpio.conf.d/90-steamif
# The script and pacman hook that keep the initramfs file right at every kernel change. # The script and pacman hook that keep the initramfs file right at every kernel change.
NVIDIA_SCRIPT=${NVIDIA_SCRIPT:-/usr/local/libexec/steamify-nvidia-initramfs} NVIDIA_SCRIPT=${NVIDIA_SCRIPT:-/usr/local/libexec/steamify-nvidia-initramfs}
NVIDIA_HOOK=${NVIDIA_HOOK:-/etc/pacman.d/hooks/85-steamify-nvidia-initramfs.hook} NVIDIA_HOOK=${NVIDIA_HOOK:-/etc/pacman.d/hooks/85-steamify-nvidia-initramfs.hook}
# Keeps video memory over suspend (with the nvidia-suspend/resume services).
NVIDIA_MODPROBE=${NVIDIA_MODPROBE:-/etc/modprobe.d/90-steamify-nvidia.conf}
NVIDIA_SLEEP_UNITS="nvidia-suspend.service nvidia-resume.service nvidia-hibernate.service"
# 32-bit parts Steam games and the 32-bit MangoHud preload need.
NVIDIA_LIB32_PKGS="lib32-nvidia-utils lib32-libxkbcommon"
# The running kernel's command line; the tests point this at a file. # The running kernel's command line; the tests point this at a file.
NVIDIA_CMDLINE=${NVIDIA_CMDLINE:-/proc/cmdline} NVIDIA_CMDLINE=${NVIDIA_CMDLINE:-/proc/cmdline}
# The DRM devices in sysfs; the tests point this at a fake tree. # The DRM devices in sysfs; the tests point this at a fake tree.
@@ -32,9 +37,11 @@ nvidia_present() {
return 1 return 1
} }
# Shown on NVIDIA PCs, unless the SteamOS conversion is already on there (it # The SteamOS conversion with the patched gamescope (lib/gamescope-nvidia.sh) replaces this on a supported card, so
# has to be turned off first: both would start Steam at login). # this is for older NVIDIA cards, and for a PC where it is already on (so it can be turned off, or swapped for the
nvidia_available() { nvidia_present && ! gaming_status 2>/dev/null; } # conversion). It and the conversion exclude each other (both would start Steam at login): the menu unticks one when
# the other is ticked.
nvidia_available() { nvidia_present && { ! nvidia_supported || nvidia_status; }; }
bigpicture_available() { nvidia_available; } bigpicture_available() { nvidia_available; }
nvidia_status() { nvidia_status() {
@@ -62,6 +69,7 @@ nvidia_enable() {
nvidia_write_unit "$unit_args" || return 1 nvidia_write_unit "$unit_args" || return 1
user_systemctl enable "$NVIDIA_UNIT" >/dev/null 2>&1 || { err "Enabling $NVIDIA_UNIT failed."; return 1; } user_systemctl enable "$NVIDIA_UNIT" >/dev/null 2>&1 || { err "Enabling $NVIDIA_UNIT failed."; return 1; }
nvidia_kernel_enable || return 1 nvidia_kernel_enable || return 1
nvidia_extras_enable || return 1
ok "Steam starts at your next login." ok "Steam starts at your next login."
} }
@@ -70,13 +78,19 @@ nvidia_disable() {
user_systemctl disable --now "$NVIDIA_UNIT" >/dev/null 2>&1 user_systemctl disable --now "$NVIDIA_UNIT" >/dev/null 2>&1
rm -f "$unit" rm -f "$unit"
user_systemctl daemon-reload user_systemctl daemon-reload
# Swapped for the SteamOS conversion (turned on first, in the same run): it needs the same settings, they stay.
gaming_status 2>/dev/null || nvidia_extras_disable
pkgs="$(state_get nvidia installed_pkgs)" pkgs="$(state_get nvidia installed_pkgs)"
if gaming_status 2>/dev/null; then
local p; pkgs=" $pkgs "
for p in $NVIDIA_LIB32_PKGS; do pkgs="${pkgs// $p / }"; done
fi
# Only what Steamify installed; games and the Steam folder stay. # Only what Steamify installed; games and the Steam folder stay.
# shellcheck disable=SC2086 # a list of package names # shellcheck disable=SC2086 # a list of package names
[[ -n "$pkgs" ]] && sudo pacman -Rns --noconfirm $pkgs >/dev/null 2>&1 [[ -n "$pkgs" ]] && sudo pacman -Rns --noconfirm $pkgs >/dev/null 2>&1
state_clear nvidia state_clear nvidia
krevert bigpicture krevert bigpicture
nvidia_kernel_disable gaming_status 2>/dev/null || nvidia_kernel_disable
ok "Steam no longer starts at login." ok "Steam no longer starts at login."
} }
@@ -118,7 +132,7 @@ nvsilent_disable() {
nvidia_supported() { nvidia_supported() {
# A supported NVIDIA GPU: PCI vendor 0x10de, display class, its kernel # A supported NVIDIA GPU: PCI vendor 0x10de, display class, its kernel
# driver installed, and not older than the RTX 20 series, decided like the # driver installed, and not older than Turing (GTX 16 / RTX 20 series: the cards NVIDIA's open kernel driver supports), decided like the
# VRAM booster does (vram_nvidia_legacy_id: chwd's legacy card lists, every # VRAM booster does (vram_nvidia_legacy_id: chwd's legacy card lists, every
# other card runs NVIDIA's open modules). Older cards are left alone. # other card runs NVIDIA's open modules). Older cards are left alone.
local d local d
@@ -254,6 +268,48 @@ nvidia_kernel_enable() {
return 0 return 0
} }
nvidia_extras_enable() {
# Video memory kept over sleep, the matching services and the 32-bit libraries (a supported card only).
nvidia_supported || return 0
local pkg u units="" prev missing=()
if [[ ! -f "$NVIDIA_MODPROBE" ]]; then
info "Keeping video memory over suspend (NVreg_PreserveVideoMemoryAllocations=1)..."
printf '%s\n' '# Added by Steamify (Gaming on NVIDIA)' 'options nvidia NVreg_PreserveVideoMemoryAllocations=1' |
sudo tee "$NVIDIA_MODPROBE" >/dev/null || { err "Writing $NVIDIA_MODPROBE failed."; return 1; }
# The NVIDIA modules load from the initramfs, which carries modprobe.d.
nvidia_rebuild_boot || warn "Rebuilding the initramfs failed: the suspend setting applies once it is rebuilt."
fi
for u in $NVIDIA_SLEEP_UNITS; do
systemctl is-enabled -q "$u" 2>/dev/null && continue
sudo systemctl enable "$u" >/dev/null 2>&1 && units+="${units:+ }$u"
done
if [[ -n "$units" ]]; then
prev="$(state_get nvidia enabled_units)"
state_set nvidia enabled_units "${prev:+$prev }$units"
fi
for pkg in $NVIDIA_LIB32_PKGS; do pacman -Q "$pkg" >/dev/null 2>&1 || missing+=("$pkg"); done
if [[ ${#missing[@]} -gt 0 ]]; then
info "Installing the 32-bit libraries games need: ${missing[*]}"
if sudo pacman -S --needed --noconfirm "${missing[@]}"; then
prev="$(state_get nvidia installed_pkgs)"
state_set nvidia installed_pkgs "${prev:+$prev }${missing[*]}"
else
warn "Installing ${missing[*]} failed (is [multilib] enabled in /etc/pacman.conf?): 32-bit games may not start."
fi
fi
return 0
}
nvidia_extras_disable() {
# Only what Steamify enabled; the 32-bit packages go with installed_pkgs.
local u
for u in $(state_get nvidia enabled_units); do sudo systemctl disable "$u" >/dev/null 2>&1; done
if [[ -f "$NVIDIA_MODPROBE" ]]; then
sudo rm -f "$NVIDIA_MODPROBE"
nvidia_rebuild_boot || true
fi
}
nvidia_kernel_disable() { nvidia_kernel_disable() {
local f changed=0; f="$(nvidia_boot_file)" local f changed=0; f="$(nvidia_boot_file)"
if [[ -n "$f" ]] && grep -q "$NVIDIA_PARAMS" "$f" 2>/dev/null; then if [[ -n "$f" ]] && grep -q "$NVIDIA_PARAMS" "$f" 2>/dev/null; then
+1
View File
@@ -16,3 +16,4 @@ read and reviewed on their own. `lib/*.sh` reads them with `patch_file
| `steamify-os-release.sh`, `steamify-os-release.hook` | `lib/login-manager.sh` (SteamOS conversion) | What Steam's System settings show besides the OS name (which stays CachyOS's): `VERSION_ID=steamos-X.Y`, `VERSION_CODENAME=steam-machine`, `VARIANT`/`VARIANT_ID` Steamify with its version, in `/etc/os-release`; the pacman hook runs it again after cachyos-hooks (`fill SCRIPT=... VERSION=... STEAMOS=...`) | | `steamify-os-release.sh`, `steamify-os-release.hook` | `lib/login-manager.sh` (SteamOS conversion) | What Steam's System settings show besides the OS name (which stays CachyOS's): `VERSION_ID=steamos-X.Y`, `VERSION_CODENAME=steam-machine`, `VARIANT`/`VARIANT_ID` Steamify with its version, in `/etc/os-release`; the pacman hook runs it again after cachyos-hooks (`fill SCRIPT=... VERSION=... STEAMOS=...`) |
| `steamify-nvidia-initramfs.sh`, `steamify-nvidia-initramfs.hook` | `lib/nvidia.sh` (SteamOS conversion, NVIDIA fix) | The pacman hook (before the initramfs is built, after DKMS) and its script: the NVIDIA modules go into the initramfs only while every installed kernel has them, decided again at every kernel or driver change (`fill SCRIPT=...`) | | `steamify-nvidia-initramfs.sh`, `steamify-nvidia-initramfs.hook` | `lib/nvidia.sh` (SteamOS conversion, NVIDIA fix) | The pacman hook (before the initramfs is built, after DKMS) and its script: the NVIDIA modules go into the initramfs only while every installed kernel has them, decided again at every kernel or driver change (`fill SCRIPT=...`) |
| `cros-ec-cec-single-port.patch` | `lib/cec.sh` (HDMI-CEC) | Makes Valve's Steam Machine CEC driver find amdgpu's HDMI port | | `cros-ec-cec-single-port.patch` | `lib/cec.sh` (HDMI-CEC) | Makes Valve's Steam Machine CEC driver find amdgpu's HDMI port |
| `gamescope-gbm-scanout.patch` | `lib/nvidia.sh` (gamescope on NVIDIA) | gamescope 3.16.31 patch: scan-out buffers allocated with GBM (opt-in, `gamescope_drm_gbm_scanout=1`), which cures the corrupted picture on NVIDIA; from farnoy/gamescope, see the header of the file |
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -15,11 +15,11 @@
set -uo pipefail set -uo pipefail
# Release version, see CHANGELOG.md. # Release version, see CHANGELOG.md.
VERSION=2.11.1 VERSION=2.11.2
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
for lib in common state packages login-manager single-user steam-desktop steam-machine fremont-poweroff vram-booster hdmi-refresh nvidia controllers cec boot-session vapor-theme steamos-extras bios desktop-shortcut wizard-shortcut steam-game update-notifier first-login menu backend; do for lib in common state packages login-manager single-user steam-desktop steam-machine fremont-poweroff vram-booster hdmi-refresh nvidia gamescope-nvidia controllers cec boot-session vapor-theme steamos-extras bios desktop-shortcut wizard-shortcut steam-game update-notifier first-login menu backend; do
# shellcheck source=/dev/null # shellcheck source=/dev/null
source "$SCRIPT_DIR/lib/$lib.sh" source "$SCRIPT_DIR/lib/$lib.sh"
done done
+9 -2
View File
@@ -78,14 +78,21 @@ Item {
w[id] = !w[id]; w[id] = !w[id];
// The same rules as the terminal menu (toggle_component). // The same rules as the terminal menu (toggle_component).
var hasGaming = items.some(function (i) { return i.id === "gaming"; }); var hasGaming = items.some(function (i) { return i.id === "gaming"; });
if (id === "gaming" && !w.gaming) { w.single = false; w.silent = false; w.glyphs = false; } var hasNvidia = items.some(function (i) { return i.id === "nvidia"; });
if (id === "single" && w.single && hasGaming) w.gaming = true; // Single user mode works without the conversion on NVIDIA PCs.
if (id === "gaming" && !w.gaming) { if (!hasNvidia) w.single = false; w.silent = false; w.glyphs = false; }
if (id === "single" && w.single && hasGaming && !hasNvidia) w.gaming = true;
if (id === "nvidia") w.bigpicture = w.nvidia; if (id === "nvidia") w.bigpicture = w.nvidia;
if (id === "bigpicture" && w.bigpicture) { w.nvidia = true; w.nvsilent = false; } if (id === "bigpicture" && w.bigpicture) { w.nvidia = true; w.nvsilent = false; }
if (id === "nvsilent" && w.nvsilent) { w.nvidia = true; w.bigpicture = false; } if (id === "nvsilent" && w.nvsilent) { w.nvidia = true; w.bigpicture = false; }
if (id === "nvidia" && !w.nvidia) w.nvsilent = false; if (id === "nvidia" && !w.nvidia) w.nvsilent = false;
if (id === "silent" && w.silent) w.gaming = true; if (id === "silent" && w.silent) w.gaming = true;
if (id === "glyphs" && w.glyphs) w.gaming = true; if (id === "glyphs" && w.glyphs) w.gaming = true;
// On NVIDIA the conversion and "Gaming on NVIDIA" exclude each other (both would start Steam at login).
if (hasGaming && hasNvidia) {
if (id === "nvidia" && w.nvidia) { w.gaming = false; w.silent = false; w.glyphs = false; }
else if ((id === "gaming" || id === "silent" || id === "glyphs") && w[id] && w.gaming) { w.nvidia = false; w.bigpicture = false; w.nvsilent = false; }
}
if (id === "machine") w.poweroff = w.machine; if (id === "machine") w.poweroff = w.machine;
if (id === "poweroff" && w.poweroff) w.machine = true; if (id === "poweroff" && w.poweroff) w.machine = true;
if (id === "machine" && !w.machine) w.kpin = false; if (id === "machine" && !w.machine) w.kpin = false;