mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-13 18:37:30 +02:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06ffc8bc8b | ||
|
|
5b5181f33e | ||
|
|
03f9e87cf2 | ||
|
|
4325d80f09 | ||
|
|
f3cd053ea0 | ||
|
|
2811ecce1c | ||
|
|
515019770f | ||
|
|
0ba94b23d8 | ||
|
|
127b8cf88b | ||
|
|
4d60dd227d | ||
|
|
ce4bc67e8c |
No files matched your search
@@ -5,6 +5,12 @@ All notable changes, per version and per commit. Versions follow
|
||||
`steamify.sh`. Versions before 0.7.0 were numbered afterwards,
|
||||
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 the recipe and patch Steamify carries (`patches/`, prepared in [steamify-gamescope-nvidia](https://github.com/theupriser/steamify-gamescope-nvidia); gamescope 3.16.31, so a Steamify release builds the version it was tested with) (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`). It replaces "Gaming on NVIDIA", which is not offered any more (the kernel parameters, early modules, suspend memory and the 32-bit libraries come with the conversion on a supported card; a PC that had "Gaming on NVIDIA" on has it turned off when the conversion is turned on). 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
|
||||
|
||||
- `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**
|
||||
|
||||
+22
-4
@@ -238,10 +238,27 @@ 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
|
||||
the Plasma desktop session, smooth and clean.
|
||||
|
||||
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
|
||||
off). `nvidia` ("Gaming on NVIDIA", `lib/nvidia.sh`) takes its place, hidden while the conversion is on (both would start
|
||||
Steam at login): it installs `steam` when missing (recorded in state `nvidia`, removed again only then) and enables the user
|
||||
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`), carried in
|
||||
`patches/` (`gamescope-gbm-scanout.patch` and the recipe `gamescope-nvidia.PKGBUILD`, kept in sync with
|
||||
[steamify-gamescope-nvidia](https://github.com/theupriser/steamify-gamescope-nvidia), where new gamescope versions are
|
||||
prepared). `gsn_install_package` writes both into a temporary folder, builds the package there as the user (`makepkg -sf`: it
|
||||
downloads Valve's gamescope at the PKGBUILD's `pkgver`, the version the patch was tested with, and its submodules; no checksums) and
|
||||
installs it with `pacman -U --ask 4` (the package provides and conflicts with `gamescope`). A Steamify release therefore always
|
||||
builds the gamescope version it was tested with. 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 every NVIDIA PC (`nvidia_present`: PCI vendor 0x10de, display class, its driver providing
|
||||
`nvidia_drm`), together with what "Gaming on NVIDIA" set up (on a supported card, `nvidia_supported`: GTX 16 / RTX 20 series or
|
||||
newer, Turing and later): the kernel parameters, the early modules, suspend memory, the 32-bit libraries (`nvidia_kernel_enable`,
|
||||
`nvidia_extras_enable`). So the SteamOS conversion is the one gaming option on NVIDIA now, and "Gaming on NVIDIA" (below) is not
|
||||
offered any more (`nvidia_available`); a PC that had it on keeps it until the conversion is turned on, which turns it off
|
||||
(`nvidia_swap_out`). Turning the conversion off removes the setting and those settings, and keeps the packages. The package is
|
||||
pinned to the gamescope release in the PKGBUILD: pacman does not update it, a newer one comes with a newer Steamify
|
||||
(the bump is prepared in the repository above), and Steamify does not rebuild it by itself yet. Tested on an RTX 5080 only.
|
||||
|
||||
Before 2.11.2, with an NVIDIA GPU the SteamOS conversion (`gaming`, and its options `boot`, `single`, `glyphs`) wasn't offered, unless
|
||||
it was already on. `nvidia` ("Gaming on NVIDIA", `lib/nvidia.sh`) took its place (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
|
||||
`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
|
||||
@@ -572,6 +589,7 @@ immediately, which can turn into a loop - see
|
||||
| `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/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/vram-booster.sh` | VRAM booster (`dmemcg-booster`, `plasma-foreground-booster`) |
|
||||
| `services/` | The systemd units the scripts install (`service_file`, `@KEY@` placeholders); see its README |
|
||||
|
||||
@@ -147,7 +147,6 @@ backend_apply() {
|
||||
for id in "${want[@]}"; do [[ "$id" == "$c" ]] && WANTED[$c]=1; done
|
||||
done
|
||||
# The same rules as the menu's toggles.
|
||||
# (Single user mode only needs the conversion where it is offered: not on NVIDIA PCs.)
|
||||
[[ "${WANTED[single]:-0}" == 1 ]] && component_available gaming && WANTED[gaming]=1
|
||||
if component_available gaming; then
|
||||
[[ "${WANTED[gaming]:-0}" == 0 ]] && { WANTED[single]=0; WANTED[boot]=0; }
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#!/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 are in
|
||||
# patches/ (kept in sync with https://github.com/theupriser/steamify-gamescope-nvidia, where new gamescope versions are
|
||||
# prepared); 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 every NVIDIA PC (`nvidia_present`); the kernel
|
||||
# parameters and the rest of lib/nvidia.sh's setup only on a supported card (`nvidia_supported`): GTX 16 / RTX 20 series or
|
||||
# newer (Turing and later, what NVIDIA's open kernel driver supports). Tested on an RTX 5080 only.
|
||||
# Sourced by steamify.sh; not meant to be run on its own.
|
||||
|
||||
GSN_PKG=steamify-gamescope-nvidia
|
||||
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 recipe and patch Steamify carries (patches/, so a Steamify release builds exactly the
|
||||
# gamescope version it was tested with) and installs it. makepkg runs as the user, never as root, and downloads
|
||||
# gamescope's sources (Valve's repository at the PKGBUILD's pkgver, and its submodules). 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 cache="${XDG_CACHE_HOME:-$HOME/.cache}/steamify"
|
||||
# On disk, not /tmp: the installer's chroot has a tmpfs there (RAM), and the build is 1-2 GB.
|
||||
mkdir -p "$cache" && dir="$(mktemp -d -p "$cache" gamescope-build.XXXXXX)" || return 1
|
||||
patch_file gamescope-nvidia.PKGBUILD > "$dir/PKGBUILD" &&
|
||||
patch_file gamescope-gbm-scanout.patch > "$dir/gamescope-gbm-scanout.patch" || {
|
||||
err "Couldn't write the build files."
|
||||
rm -rf "$dir"; return 1
|
||||
}
|
||||
if ! (cd "$dir" && 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"/"$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_present || return 0
|
||||
# A PC that had "Gaming on NVIDIA" on: Steam must not also start on the desktop.
|
||||
nvidia_swap_out
|
||||
# What NVIDIA's DRM stack wants (lib/nvidia.sh; a supported card only, the functions check): 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_present || return 0
|
||||
nvidia_extras_disable
|
||||
nvidia_kernel_disable
|
||||
}
|
||||
@@ -94,6 +94,8 @@ gaming_enable() {
|
||||
# LOGIN_MANAGER (sddm with single user, else plasmalogin) is set by the
|
||||
# menu. Re-running with the other value switches over cleanly.
|
||||
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
|
||||
sddm)
|
||||
switch_to_sddm || return 1
|
||||
@@ -122,6 +124,7 @@ gaming_disable() {
|
||||
switch_to_plasmalogin
|
||||
remove_desktop_shortcut
|
||||
steam_disable
|
||||
gsn_disable
|
||||
krevert gaming
|
||||
os_name_disable
|
||||
ok "The PC boots to the normal login screen again (from the next boot)."
|
||||
|
||||
+17
-7
@@ -26,7 +26,7 @@ NO_PRESELECT=(boot silent nvsilent cec kpin hdmi extended_controller_support)
|
||||
# FEATURE_BASELINE.
|
||||
FEATURE_BASELINE=2.1.0
|
||||
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
|
||||
[kpin]=2.1.0 [hdmi]=2.1.0
|
||||
)
|
||||
@@ -57,11 +57,9 @@ declare -A CURRENT WANTED
|
||||
|
||||
component_available() {
|
||||
case "$1" in
|
||||
# gamescope's own session is broken on NVIDIA: the conversion is replaced by "Gaming on NVIDIA" there (shown
|
||||
# anyway when it's already on, so it can be turned off).
|
||||
gaming|boot|silent|glyphs) ! nvidia_present || gaming_status ;;
|
||||
nvidia) nvidia_available ;;
|
||||
bigpicture|nvsilent) bigpicture_available ;;
|
||||
# The SteamOS conversion is offered on NVIDIA PCs too: it installs the patched gamescope there (lib/gamescope-nvidia.sh)
|
||||
# and turns off "Gaming on NVIDIA" (lib/nvidia.sh), which is not offered any more (nvidia_available).
|
||||
nvidia|bigpicture|nvsilent) nvidia_available ;;
|
||||
machine|poweroff) machine_available ;;
|
||||
vram) vram_available ;;
|
||||
# Steamify in the Steam library is for gaming mode's controller: not needed for Big Picture on the desktop (NVIDIA PCs;
|
||||
@@ -115,6 +113,8 @@ feature_outdated() {
|
||||
# On, but set up by an older version of that feature (compared as
|
||||
# versions: 2.10.0 is newer than 2.9.0).
|
||||
local have want
|
||||
# "Gaming on NVIDIA" is on: the SteamOS conversion replaces it, as an update of what the PC has (lib/nvidia.sh).
|
||||
[[ "$1" == gaming ]] && nvidia_migration_pending && return 0
|
||||
[[ "${CURRENT[$1]:-0}" == 1 ]] || return 1
|
||||
have="$(state_get features "$1" "$FEATURE_BASELINE")"
|
||||
[[ "$have" == off ]] && have="$FEATURE_BASELINE"
|
||||
@@ -184,6 +184,17 @@ detect_components() {
|
||||
component_available "$c" || continue
|
||||
{ feature_outdated "$c" || feature_new "$c"; } && WANTED[$c]=1
|
||||
done
|
||||
# "Gaming on NVIDIA" was on: its replacement, the SteamOS conversion, comes with the defaults of a first run, and the
|
||||
# PC starts the way it did: Steam in Big Picture at login becomes booting into gaming mode, any other Steam start
|
||||
# (a normal window, or silent in the tray) becomes booting into the desktop, with the silent start kept.
|
||||
if nvidia_migration_pending; then
|
||||
WANTED[glyphs]=1
|
||||
if bigpicture_status; then WANTED[boot]=0
|
||||
else
|
||||
WANTED[boot]=1
|
||||
nvsilent_status && WANTED[silent]=1
|
||||
fi
|
||||
fi
|
||||
# The kernel pin is no longer needed (the power-off fix), and HDMI
|
||||
# refresh boost needed the pin: whatever is left of either is unticked,
|
||||
# so a normal run removes it.
|
||||
@@ -296,7 +307,6 @@ toggle_component() {
|
||||
component_selectable "$c" || return 1
|
||||
WANTED[$c]=$(( 1 - WANTED[$c] ))
|
||||
# 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.)
|
||||
if [[ "$c" == single && "${WANTED[single]}" == 1 ]] && component_available gaming; then WANTED[gaming]=1; fi
|
||||
if [[ "$c" == gaming && "${WANTED[gaming]}" == 0 ]]; then WANTED[single]=0; WANTED[boot]=0; fi
|
||||
# Where to boot to is part of the conversion, too.
|
||||
|
||||
+77
-5
@@ -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.
|
||||
NVIDIA_SCRIPT=${NVIDIA_SCRIPT:-/usr/local/libexec/steamify-nvidia-initramfs}
|
||||
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.
|
||||
NVIDIA_CMDLINE=${NVIDIA_CMDLINE:-/proc/cmdline}
|
||||
# The DRM devices in sysfs; the tests point this at a fake tree.
|
||||
@@ -32,9 +37,27 @@ nvidia_present() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# Shown on NVIDIA PCs, unless the SteamOS conversion is already on there (it
|
||||
# has to be turned off first: both would start Steam at login).
|
||||
nvidia_available() { nvidia_present && ! gaming_status 2>/dev/null; }
|
||||
# Not offered any more (2.11.2): the SteamOS conversion with the patched gamescope (lib/gamescope-nvidia.sh) covers NVIDIA PCs.
|
||||
# A PC that has this on keeps it until the conversion is turned on, which calls nvidia_swap_out.
|
||||
nvidia_available() { return 1; }
|
||||
|
||||
nvidia_migration_pending() {
|
||||
# "Gaming on NVIDIA" is on (set up before 2.11.2) and the SteamOS conversion that replaces it isn't: the menu ticks the
|
||||
# conversion and shows it as an update, so a normal run moves the PC over (nvidia_swap_out in gsn_enable).
|
||||
nvidia_present && nvidia_status && ! gaming_status 2>/dev/null
|
||||
}
|
||||
|
||||
nvidia_swap_out() {
|
||||
# The conversion takes over: Steam no longer starts by itself on the desktop at login (both would start it). Steam, the
|
||||
# packages and the NVIDIA settings stay: the conversion needs them too. The state stays for the conversion's own disable.
|
||||
nvidia_status || return 0
|
||||
info "Gaming on NVIDIA is replaced by the SteamOS conversion: Steam no longer starts on the desktop at login."
|
||||
user_systemctl disable --now "$NVIDIA_UNIT" >/dev/null 2>&1
|
||||
rm -f "$(nvidia_unit_file)"
|
||||
user_systemctl daemon-reload
|
||||
krevert bigpicture
|
||||
return 0
|
||||
}
|
||||
bigpicture_available() { nvidia_available; }
|
||||
|
||||
nvidia_status() {
|
||||
@@ -62,6 +85,7 @@ nvidia_enable() {
|
||||
nvidia_write_unit "$unit_args" || return 1
|
||||
user_systemctl enable "$NVIDIA_UNIT" >/dev/null 2>&1 || { err "Enabling $NVIDIA_UNIT failed."; return 1; }
|
||||
nvidia_kernel_enable || return 1
|
||||
nvidia_extras_enable || return 1
|
||||
ok "Steam starts at your next login."
|
||||
}
|
||||
|
||||
@@ -70,13 +94,19 @@ nvidia_disable() {
|
||||
user_systemctl disable --now "$NVIDIA_UNIT" >/dev/null 2>&1
|
||||
rm -f "$unit"
|
||||
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)"
|
||||
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.
|
||||
# shellcheck disable=SC2086 # a list of package names
|
||||
[[ -n "$pkgs" ]] && sudo pacman -Rns --noconfirm $pkgs >/dev/null 2>&1
|
||||
state_clear nvidia
|
||||
krevert bigpicture
|
||||
nvidia_kernel_disable
|
||||
gaming_status 2>/dev/null || nvidia_kernel_disable
|
||||
ok "Steam no longer starts at login."
|
||||
}
|
||||
|
||||
@@ -118,7 +148,7 @@ nvsilent_disable() {
|
||||
|
||||
nvidia_supported() {
|
||||
# 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
|
||||
# other card runs NVIDIA's open modules). Older cards are left alone.
|
||||
local d
|
||||
@@ -254,6 +284,48 @@ nvidia_kernel_enable() {
|
||||
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() {
|
||||
local f changed=0; f="$(nvidia_boot_file)"
|
||||
if [[ -n "$f" ]] && grep -q "$NVIDIA_PARAMS" "$f" 2>/dev/null; then
|
||||
|
||||
@@ -16,3 +16,5 @@ 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-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 |
|
||||
| `gamescope-gbm-scanout.patch` | `lib/gamescope-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 |
|
||||
| `gamescope-nvidia.PKGBUILD` | `lib/gamescope-nvidia.sh` (gamescope on NVIDIA) | The recipe for the patched gamescope package (`steamify-gamescope-nvidia`, provides and conflicts with `gamescope`): Valve's gamescope at `pkgver` plus `gamescope-gbm-scanout.patch`; written with the patch to a temporary folder and built with `makepkg` |
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,124 @@
|
||||
# Maintainer: theupriser
|
||||
# Based on Arch Linux's gamescope PKGBUILD (Maxime Gauduin, Giancarlo Razzolini, Sven-Hendrik Haase and contributors).
|
||||
#
|
||||
# gamescope with GBM-allocated scan-out buffers for NVIDIA (opt-in: gamescope_drm_gbm_scanout=1).
|
||||
# The patch is gamescope-gbm-scanout.patch (next to this file; see its header for where it comes from). pkgver is the gamescope
|
||||
# release the patch was made for and tested with. Kept in sync with https://github.com/theupriser/steamify-gamescope-nvidia;
|
||||
# Steamify (lib/gamescope-nvidia.sh) writes both files into a temporary folder and runs makepkg there.
|
||||
|
||||
pkgname=steamify-gamescope-nvidia
|
||||
_srcname=gamescope
|
||||
pkgver=3.16.31
|
||||
pkgrel=1
|
||||
pkgdesc='SteamOS session compositing window manager, with GBM scan-out for NVIDIA (opt-in: gamescope_drm_gbm_scanout=1)'
|
||||
arch=(x86_64)
|
||||
url=https://github.com/theupriser/steamify-gamescope-nvidia
|
||||
license=(
|
||||
BSD-2-Clause
|
||||
BSD-3-Clause
|
||||
LicenseRef-Reshade
|
||||
)
|
||||
provides=("gamescope=$pkgver")
|
||||
conflicts=(gamescope gamescope-nvidia-gbm)
|
||||
replaces=(gamescope-nvidia-gbm)
|
||||
depends=(
|
||||
glibc
|
||||
mesa
|
||||
libstdc++
|
||||
libgcc
|
||||
lcms2
|
||||
libavif
|
||||
libcap.so
|
||||
libdecor
|
||||
libdrm
|
||||
libei
|
||||
libinput
|
||||
libpipewire-0.3.so
|
||||
libx11
|
||||
libxcb
|
||||
libxcomposite
|
||||
libxcursor
|
||||
libxdamage
|
||||
libxext
|
||||
libxfixes
|
||||
libxi
|
||||
libxkbcommon.so
|
||||
libxmu
|
||||
libxrender
|
||||
libxres
|
||||
libxtst
|
||||
libxxf86vm
|
||||
luajit
|
||||
pixman
|
||||
sdl2
|
||||
seatd
|
||||
systemd-libs
|
||||
vulkan-icd-loader
|
||||
wayland
|
||||
xcb-util-errors
|
||||
xcb-util-wm
|
||||
xorg-server-xwayland
|
||||
)
|
||||
makedepends=(
|
||||
benchmark
|
||||
cmake
|
||||
git
|
||||
glslang
|
||||
meson
|
||||
ninja
|
||||
vulkan-headers
|
||||
wayland-protocols
|
||||
catch2
|
||||
)
|
||||
source=(
|
||||
gamescope::git+https://github.com/ValveSoftware/gamescope.git#commit=${pkgver}
|
||||
gamescope-gbm-scanout.patch
|
||||
git+https://gitlab.freedesktop.org/emersion/libdisplay-info.git
|
||||
git+https://gitlab.freedesktop.org/emersion/libliftoff.git
|
||||
git+https://github.com/ValveSoftware/openvr.git
|
||||
git+https://github.com/Joshua-Ashton/reshade.git
|
||||
git+https://github.com/KhronosGroup/SPIRV-Headers.git
|
||||
git+https://github.com/Joshua-Ashton/vkroots.git
|
||||
git+https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||
)
|
||||
b2sums=('SKIP'
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
'SKIP')
|
||||
|
||||
prepare() {
|
||||
cd gamescope
|
||||
|
||||
# GBM scan-out for NVIDIA. If it no longer applies to this gamescope version, stop here: the build must not
|
||||
# silently produce an unpatched gamescope under this package's name.
|
||||
git apply --check ../gamescope-gbm-scanout.patch || { echo "gbm patch does not apply to gamescope ${pkgver}" >&2; return 1; }
|
||||
git apply ../gamescope-gbm-scanout.patch
|
||||
|
||||
meson subprojects download
|
||||
|
||||
for submodule in src/reshade subprojects/{libdisplay-info,libliftoff,openvr,vkroots,wlroots} thirdparty/SPIRV-Headers; do
|
||||
git submodule init ${submodule}
|
||||
git config submodule.${submodule}.url ../${submodule##*/}
|
||||
done
|
||||
git -c protocol.file.allow=always submodule update
|
||||
}
|
||||
|
||||
build() {
|
||||
arch-meson gamescope build \
|
||||
-Dforce_fallback_for=glm,stb,libdisplay-info,libliftoff,vkroots \
|
||||
-Dpipewire=enabled
|
||||
meson compile -C build
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="${pkgdir}" meson install -C build \
|
||||
--skip-subprojects
|
||||
install -Dm 644 gamescope/LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
|
||||
}
|
||||
|
||||
# vim: ts=2 sw=2 et:
|
||||
+2
-2
@@ -15,11 +15,11 @@
|
||||
set -uo pipefail
|
||||
|
||||
# Release version, see CHANGELOG.md.
|
||||
VERSION=2.11.1
|
||||
VERSION=2.11.2
|
||||
|
||||
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
|
||||
source "$SCRIPT_DIR/lib/$lib.sh"
|
||||
done
|
||||
|
||||
+4
-2
@@ -65,7 +65,8 @@ Item {
|
||||
var w = {};
|
||||
for (var i = 0; i < items.length; i++) w[items[i].id] = items[i].kind === "action" ? false : items[i].wanted;
|
||||
want = w;
|
||||
boot = nowOn("boot") ? "desktop" : "gamescope";
|
||||
// (What the PC has, or what the backend ticked: "Gaming on NVIDIA" moving to the conversion keeps how Steam started.)
|
||||
boot = want.boot ? "desktop" : "gamescope";
|
||||
if (sel > rows.length) sel = 0;
|
||||
}
|
||||
Connections { target: backend; function onStatusChanged() { if (app.screen === "menu" || app.screen === "done") app.syncFromStatus(); } }
|
||||
@@ -101,7 +102,8 @@ Item {
|
||||
if (it.kind !== "toggle") continue;
|
||||
if (hidden(it)) { if (it.on) p.push({ id: it.id, action: "off" }); continue; }
|
||||
if (it.parent && !want[it.parent]) { if (it.on) p.push({ id: it.id, action: "off" }); continue; }
|
||||
if (want[it.id] && !it.on) p.push({ id: it.id, action: "on", isNew: !!it["new"] });
|
||||
// (An item that is off but flagged "update" replaces what the PC has: the conversion for "Gaming on NVIDIA".)
|
||||
if (want[it.id] && !it.on) p.push({ id: it.id, action: it.update ? "update" : "on", isNew: !!it["new"] });
|
||||
else if (!want[it.id] && it.on) p.push({ id: it.id, action: "off" });
|
||||
else if (want[it.id] && (reapply || it.update)) p.push({ id: it.id, action: reapply ? "again" : "update" });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user