diff --git a/NOTICE b/NOTICE index 13ca203..1ec89b4 100644 --- a/NOTICE +++ b/NOTICE @@ -17,9 +17,10 @@ Release zips (scripts/package_release.sh) also bundle binaries of ZLUDA (Apache- LLVM under Apache-2.0 with LLVM exceptions), the patched vkd3d-proton (LGPL-2.1) and OptiScaler (https://github.com/optiscaler/OptiScaler, GPL-3.0, unmodified). Each zip carries their license texts in d4r/licenses and says where every file comes from in d4r/source/SOURCES.txt. -Release zips also contain NVIDIA's nvngx_dlss.dll and _nvngx.dll and DLSS kernels compiled from -NVIDIA's PTX. Those are NVIDIA's property, are not covered by this repository's license, and are -included by whoever publishes the zip. +Release zips include install.sh to download NVIDIA's nvngx_dlss.dll and _nvngx.dll separately. +Optional builds may bundle those DLLs. Release zips also include DLSS kernels compiled from NVIDIA's +PTX. Those are NVIDIA's property, are not covered by this repository's license, and are included +by whoever publishes the zip. Downloaded DLLs remain governed by NVIDIA's license terms. This repository contains no NVIDIA software. The NVIDIA DLSS feature library (nvngx_dlss.dll) and the NGX core (_nvngx.dll) are NVIDIA's; you supply your own copies, and their use is governed by diff --git a/README.md b/README.md index 73fabad..9c6ea42 100644 --- a/README.md +++ b/README.md @@ -104,12 +104,13 @@ The release zip works like an OptiScaler release: its contents go into the folde 1. Extract `d4r-.zip` there. It contains: - OptiScaler 0.9.4 as `dxgi.dll`, with an `OptiScaler.ini` set up for d4r; - the d4r-patched vkd3d-proton (`d3d12.dll`, `d3d12core.dll`); - - an `d4r` folder with the shim, the CUDA bridge, ZLUDA, the ROCm 7.2.4 runtime, the native kernels, this game's `d4r.ini`, and NVIDIA's `nvngx_dlss.dll` (310.7) and `_nvngx.dll`. -2. In Steam, select GE-Proton 11 for the game and set these launch options: `PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %command%`. + - an `d4r` folder with the shim, the CUDA bridge, ZLUDA, the ROCm 7.2.4 runtime, the native kernels, this game's `d4r.ini`, and an `install.sh` beside the `d4r` folder. +2. Run `bash install.sh` in the extracted release folder. It downloads NVIDIA DLSS 310.7.0 and NGX from official NVIDIA sources, verifies SHA-256 hashes, and places them in `d4r/nvngx_dlss.dll` and `d4r/ngx/_nvngx.dll`. Requires Bash, curl, sha256sum and 7-Zip (`7zz`, `7z` or `7za`); no sudo. The NGX download is a roughly 915 MiB driver archive which is extracted without executing it. Matching files are skipped and differing files are backed up. +3. In Steam, select GE-Proton 11 for the game and set these launch options: `PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %command%`. When updating, replace `d3d12.dll` and `d3d12core.dll` together with `d4r/nvngx.dll`. The shim requires their matching resource-lifetime extension. -ROCm does not need to be installed: the zip includes its runtime (from AMD's Ubuntu 22.04 packages, which run under Steam's container runtime on any distribution). The zip's NVIDIA files and the kernels built from NVIDIA's code are not covered by this repository's license (see [NOTICE](NOTICE)). The Proton prefix and the system are not changed. [packaging/D4R_README.txt](packaging/D4R_README.txt) is the full guide that ships in the zip; `scripts/package_release.sh` builds the zip (see [docs/building.md](docs/building.md#7-package-a-release)). +ROCm does not need to be installed: the zip includes its runtime (from AMD's Ubuntu 22.04 packages, which run under Steam's container runtime on any distribution). The downloaded NVIDIA files and the bundled kernels built from NVIDIA's code are not covered by this repository's license (see [NOTICE](NOTICE)). The Proton prefix and the system are not changed. [packaging/D4R_README.txt](packaging/D4R_README.txt) is the full guide that ships in the zip; `scripts/package_release.sh` builds the zip (see [docs/building.md](docs/building.md#7-package-a-release)). ## Requirements (building from source) diff --git a/docs/building.md b/docs/building.md index 3a818db..9f9cfb0 100644 --- a/docs/building.md +++ b/docs/building.md @@ -112,9 +112,11 @@ The script: - builds the shim, the bridge and both fast and accuracy network-layer kernels for gfx1100–gfx1103 and gfx1200–gfx1201 by default (`D4R_GPU_ARCHS` can select fewer targets); each gfx12 target also gets an `-fp8` variant; - writes the kernel manifest from the DLLs you list (it records hashes of their PTX, nothing else); - stages OptiScaler as `dxgi.dll` with the settings in `packaging/optiscaler.settings`, applied by `scripts/configure_optiscaler.py`; both full and clean ZIPs set `NvngxPath=d4r\nvngx.dll` explicitly, retaining `OptiDllPath=d4r` for other libraries; -- adds NVIDIA's two DLLs and any supplied texture kernels (built from NVIDIA's PTX by `kernels/build.sh tex`); builds accuracy texture sets with `D4R_ZLUDA_EMIT` unless marked prebuilt sets are supplied in `D4R_BUNDLE_TEX/accuracy/`; +- includes `install.sh` instead of NVIDIA's two DLLs by default, retaining any supplied texture kernels (built from NVIDIA's PTX by `kernels/build.sh tex`); builds accuracy texture sets with `D4R_ZLUDA_EMIT` unless marked prebuilt sets are supplied in `D4R_BUNDLE_TEX/accuracy/`; - zips the result together with the ZLUDA and vkd3d-proton builds, the ROCm runtime (as `d4r/rocm`), `packaging/d4r.ini`, the licenses and the patches. +`D4R_BUNDLE_NVIDIA=installer` is the default: the ZIP includes `install.sh`, and users run `bash install.sh` after extraction to fetch the pinned official NVIDIA DLLs. This mode requires `D4R_BUNDLE_DLSS` to match the DLSS 310.7.0 SHA-256 pinned in the installer, so bundled texture kernels match the downloaded library; `D4R_BUNDLE_NGX` is only needed with `D4R_BUNDLE_NVIDIA=1`, which retains the old DLL-bundling mode. + The NVIDIA files are not covered by d4r's license; redistributing them is up to whoever publishes the zip. `D4R_BUNDLE_NVIDIA=0` builds `d4r--nonvidia.zip` without them and without the texture kernels. [architecture.md](architecture.md#portable-installs-the-release-zip) describes how the installed files work together. ### GLIBC 2.41 release builds diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..469256d --- /dev/null +++ b/install.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +# Release installer: copy this beside D4R_README.txt and the extracted d4r/ folder. +set -euo pipefail +DLSS_URL=https://raw.githubusercontent.com/NVIDIA/DLSS/a291cc7d2cc642a51566f3dfd5376f635cd1b284/lib/Windows_x86_64/rel/nvngx_dlss.dll +DLSS_SHA256=be6e434a94ca32499515eb62ca0e6c274526055d568d0426e4c652dcdfb6ee6e +DRIVER_URL=https://us.download.nvidia.com/Windows/596.36/596.36-desktop-win10-win11-64bit-international-dch-whql.exe +DRIVER_SHA256=4a1793d2bc7792f43270fe8286ec381ae24409fe29049dbe1eb8530ed89e19cf +NGX_SHA256=0e3423b3b7afa1019c7ecac053a8408df8e5d9d9d904434705c6aaeacec02fef + +fail() { printf 'install.sh: %s\n' "$*" >&2; exit 1; } +if [[ ${1:-} == --help || ${1:-} == -h ]]; then + printf '%s\n' 'Usage: bash install.sh [extracted-release-directory]' \ + 'Default: the directory containing this script, regardless of your working directory.' \ + 'Downloads official NVIDIA DLSS 310.7.0 and NGX from driver 596.36 (~915 MiB).' \ + 'Requires Bash, curl, sha256sum, and 7zz, 7z or 7za. No sudo needed.' \ + 'Existing matching DLLs are kept; differing DLLs are backed up. NVIDIA license terms apply.' + exit 0 +fi +[[ $# -le 1 ]] || fail 'Usage: bash install.sh [extracted-release-directory]' +ROOT=$(cd -- "${1:-$(dirname -- "${BASH_SOURCE[0]}")}" && pwd) +[[ -f "$ROOT/d4r/nvngx.dll" && -f "$ROOT/d4r/d4r.ini" ]] || fail "Extract the release ZIP first; no d4r runtime found in $ROOT" +command -v sha256sum >/dev/null || fail 'Missing sha256sum (install coreutils).' +valid() { [[ -f "$1" ]] && [[ $(sha256sum -- "$1" | cut -d' ' -f1) == "$2" ]]; } +need_dlss=1; need_ngx=1 +valid "$ROOT/d4r/nvngx_dlss.dll" "$DLSS_SHA256" && need_dlss=0 +valid "$ROOT/d4r/ngx/_nvngx.dll" "$NGX_SHA256" && need_ngx=0 +if (( need_dlss == 0 && need_ngx == 0 )); then + echo 'NVIDIA DLLs are already installed and verified.' + exit 0 +fi +command -v curl >/dev/null || fail 'Missing curl. Install it and run this script again.' +if (( need_ngx )); then + SEVENZIP='' + for tool in 7zz 7z 7za; do + if command -v "$tool" >/dev/null; then SEVENZIP=$tool; break; fi + done + [[ -n "$SEVENZIP" ]] || fail 'Missing 7-Zip. Install 7zip (or p7zip) and run this script again.' +fi +TMP=$(mktemp -d) +STAGED='' +trap '[[ -z "$STAGED" ]] || rm -f -- "$STAGED"; rm -rf -- "$TMP"' EXIT +trap 'exit 130' INT +trap 'exit 143' TERM +download() { + curl --fail --location --show-error --retry 3 --connect-timeout 30 \ + --proto '=https' --proto-redir '=https' --output "$2" "$1" || fail "Download failed: $1. Run the installer again to retry." +} +verify() { valid "$1" "$2" || fail "SHA-256 mismatch for $1; no DLLs installed."; } +echo 'Downloading NVIDIA files under NVIDIA license terms:' +echo 'DLSS: https://github.com/NVIDIA/DLSS/blob/v310.7.0/LICENSE.txt' +echo 'Driver: https://www.nvidia.com/en-us/drivers/nvidia-license/' +if (( need_dlss )); then + echo 'Downloading DLSS 310.7.0...' + download "$DLSS_URL" "$TMP/nvngx_dlss.dll" + verify "$TMP/nvngx_dlss.dll" "$DLSS_SHA256" +fi +if (( need_ngx )); then + echo 'Downloading NVIDIA driver 596.36 (~915 MiB); extracting NGX without running the installer...' + download "$DRIVER_URL" "$TMP/driver.exe" + verify "$TMP/driver.exe" "$DRIVER_SHA256" + "$SEVENZIP" e -y -bso0 -bsp0 "-o$TMP/ngx" "$TMP/driver.exe" 'Display.Driver/_nvngx.dll' || fail 'Could not extract NGX; no DLLs installed.' + verify "$TMP/ngx/_nvngx.dll" "$NGX_SHA256" +fi +# Verify all downloads before modifying either destination. Stage on the destination +# filesystem for atomic replacement and retain a unique backup of a differing file. +place() { + local src=$1 dst=$2 backup + mkdir -p -- "$(dirname -- "$dst")" + [[ ! -d "$dst" ]] || fail "Destination is a directory: $dst" + STAGED=$(mktemp "${dst}.install.XXXXXX") + cp -- "$src" "$STAGED" + chmod 644 "$STAGED" + if [[ -e "$dst" || -L "$dst" ]]; then + backup=$(mktemp "${dst}.backup.XXXXXX") + cp -p -- "$dst" "$backup" + printf 'Saved previous DLL: %s\n' "$backup" + fi + mv -f -- "$STAGED" "$dst" + STAGED='' + printf 'Installed: %s\n' "$dst" +} +(( need_dlss == 0 )) || place "$TMP/nvngx_dlss.dll" "$ROOT/d4r/nvngx_dlss.dll" +(( need_ngx == 0 )) || place "$TMP/ngx/_nvngx.dll" "$ROOT/d4r/ngx/_nvngx.dll" +echo 'NVIDIA DLLs installed and verified. Follow D4R_README.txt for Steam launch options.' diff --git a/packaging/D4R_README.txt b/packaging/D4R_README.txt index cafb63d..3cf029d 100644 --- a/packaging/D4R_README.txt +++ b/packaging/D4R_README.txt @@ -21,6 +21,8 @@ What you need - Linux with the amdgpu kernel driver (/dev/kfd). ROCm itself is not needed: the zip includes the ROCm 7.2.4 runtime in d4r/rocm. RocmDir in d4r/d4r.ini selects another ROCm installation instead. - GE-Proton 11 (tested: GE-Proton11-3), selected for the game in Steam. +@installer - Internet access, Bash, curl, sha256sum and 7-Zip to run the included install.sh. +@installer NVIDIA DLLs are downloaded during installation, under NVIDIA's terms. @clean - Two NVIDIA files, which this zip does not include: @clean - nvngx_dlss.dll, the DLSS library, version 310.7 or 310.9 (tested: 310.7.0 and 310.9.1). @clean Many games ship one, but often an older version. The d4r kernels check the DLSS code they @@ -41,15 +43,23 @@ Install If the folder already has a dxgi.dll or OptiScaler.ini (another OptiScaler install), move those out of the way first. Also remove PROTON_USE_OPTISCALER from the game's launch options if you used GE-Proton's built-in OptiScaler: d4r brings its own. +@installer 2. Run bash install.sh from a terminal (Bash, curl, sha256sum and 7zz/7z/7za required). +@installer It downloads DLSS 310.7.0 and the NGX core from official NVIDIA sources, checks SHA-256, +@installer and installs d4r/nvngx_dlss.dll and d4r/ngx/_nvngx.dll. No sudo is needed. The driver +@installer archive is about 915 MiB; it is extracted, never executed. Downloads are temporary. +@installer Run it again to check the files; differing existing DLLs are backed up before replacement. @clean 2. Copy nvngx_dlss.dll into the d4r folder, and _nvngx.dll into d4r/ngx. +@installer 3. In Steam, open the game's Properties: @clean 3. In Steam, open the game's Properties: @full 2. In Steam, open the game's Properties: - Compatibility: force GE-Proton11-3. - Launch options: PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %command% +@installer 4. Optional: check the install from a terminal in that folder: @clean 4. Optional: check the install from a terminal in that folder: @full 3. Optional: check the install from a terminal in that folder: sh d4r/d4r-check.sh +@installer 5. Start the game and choose DLSS in its graphics settings. @clean 5. Start the game and choose DLSS in its graphics settings. @full 4. Start the game and choose DLSS in its graphics settings. @@ -130,7 +140,7 @@ If something goes wrong Uninstall --------- Delete dxgi.dll, OptiScaler.ini, OptiScaler.log (if present), d3d12.dll, d3d12core.dll, -D4R_README.txt and the d4r folder from the game folder, and clear the launch options. The kernel +D4R_README.txt, install.sh (if present) and the d4r folder from the game folder, and clear the launch options. The kernel cache in ~/.cache/d4r can be deleted too. @@ -144,3 +154,7 @@ AMD or the OptiScaler project. @full NVIDIA's files in this zip (d4r/nvngx_dlss.dll, d4r/ngx/_nvngx.dll) and the kernels built from @full NVIDIA's code (listed in d4r/source/SOURCES.txt) are NVIDIA's property, are not covered by @full d4r's license, and are included by whoever distributes this zip, not by NVIDIA. + +@installer NVIDIA DLLs are downloaded by install.sh from NVIDIA/DLSS SDK 310.7.0 and driver 596.36. +@installer The included kernels compiled from NVIDIA PTX remain NVIDIA's property and are not +@installer covered by d4r's license. See d4r/source/SOURCES.txt for their provenance. diff --git a/packaging/SOURCES.txt b/packaging/SOURCES.txt index 7a932c0..dfd0389 100644 --- a/packaging/SOURCES.txt +++ b/packaging/SOURCES.txt @@ -7,6 +7,7 @@ Built from source by d4r (Apache License 2.0, d4r/licenses/d4r-LICENSE.txt): d4r/kernels/ native RDNA3/RDNA4 kernels for the DLSS 4 and 4.5 network layers, kernels/k and kernels/m (d4r-kernels.txt lists hashes of the DLSS code each kernel replaces; it holds no NVIDIA code) d4r/d4r.ini, d4r/d4r-check.sh, D4R_README.txt +@installer install.sh downloads and verifies NVIDIA DLLs; no driver installation Third-party software, unmodified or patched by d4r: d4r/zluda/libcuda.so ZLUDA (Apache License 2.0 or MIT), https://github.com/vosen/ZLUDA @@ -40,6 +41,12 @@ Third-party software, unmodified or patched by d4r: @full this zip, not by NVIDIA: @full d4r/nvngx_dlss.dll NVIDIA DLSS Super Resolution library @DLSS_VERSION@ @full d4r/ngx/_nvngx.dll NVIDIA NGX runtime from NVIDIA's Windows display driver, @NGX_VERSION@ +@installer NVIDIA DLLs are not bundled. install.sh downloads DLSS 310.7.0 from NVIDIA/DLSS +@installer commit a291cc7d2cc642a51566f3dfd5376f635cd1b284 and _nvngx.dll from NVIDIA driver 596.36. +@installer URLs and SHA-256 hashes are pinned in install.sh. NVIDIA license terms apply. +@installer Included NVIDIA PTX-derived kernels (not covered by d4r licenses): +@installer d4r/kernels/*/hiluma_engine_output_*, rrlite_enc0_*, rrlite_dec0_*, rrlite_post_*, rrlite_downsample_* +@installer compiled from DLSS PTX by ZLUDA (kernels/tex in this repository). @full d4r/kernels/*/hiluma_engine_output_*, rrlite_enc0_*, rrlite_dec0_*, rrlite_post_*, rrlite_downsample_* @full DLSS kernels: NVIDIA's PTX from nvngx_dlss.dll with parts replaced by d4r code @full (kernels/tex in the d4r repository), compiled by ZLUDA diff --git a/scripts/package_release.sh b/scripts/package_release.sh index 5810614..339f009 100755 --- a/scripts/package_release.sh +++ b/scripts/package_release.sh @@ -22,23 +22,29 @@ # SOURCE_DATE_EPOCH timestamp given to every packaged file default: the last commit's # D4R_BUILD_INFO optional build-toolchain/provenance text to include in d4r/source/ # D4R_PACKAGE_KERNEL_JOBS independent target builds at once (default 1) -# The zip also contains NVIDIA's files and the texture kernels built from NVIDIA's PTX; redistributing +# The zip contains texture kernels built from NVIDIA's PTX; redistributing # those is up to whoever publishes it (they are not covered by d4r's license): -# D4R_BUNDLE_DLSS nvngx_dlss.dll to include D4R_BUNDLE_NGX _nvngx.dll to include +# D4R_BUNDLE_DLSS local nvngx_dlss.dll for texture builds (pinned by install.sh in installer mode) +# D4R_BUNDLE_NGX local _nvngx.dll (only required for D4R_BUNDLE_NVIDIA=1) # D4R_BUNDLE_TEX directory with texture-kernel code objects (kernels/build.sh tex), one subdirectory # per target folder (gfx1101, gfx1201, gfx1201-fp8, ...), or a flat gfx1101 directory for # older builds # Accuracy texture sets go in accuracy//, built with D4R_PREFER_ACCURACY=1. # D4R_ZLUDA_EMIT d4r_emit from the patched ZLUDA build; required in full builds when an accuracy # texture set or L's unfolded texture variants are not supplied in D4R_BUNDLE_TEX. -# D4R_BUNDLE_NVIDIA=0 leaves them out (d4r-VERSION-nonvidia.zip; users then add the two DLLs themselves). +# D4R_BUNDLE_NVIDIA=installer (default) ships install.sh instead of NVIDIA DLLs, retaining texture kernels. +# D4R_BUNDLE_NVIDIA=1 bundles both DLLs; =0 omits DLLs and texture kernels (nonvidia ZIP). set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" OUT="$(realpath -m "${1:-$ROOT/dist}")" VERSION="$(cat "$ROOT/packaging/VERSION")" -VARIANT=full -[[ "${D4R_BUNDLE_NVIDIA:-1}" == 0 ]] && VARIANT=clean +case "${D4R_BUNDLE_NVIDIA:-installer}" in + installer) VARIANT=installer ;; + 1) VARIANT=full ;; + 0) VARIANT=clean ;; + *) echo "D4R_BUNDLE_NVIDIA must be installer, 1 or 0" >&2; exit 2 ;; +esac NAME="d4r-$VERSION" [[ "$VARIANT" == clean ]] && NAME="$NAME-nonvidia" STAGE="$OUT/$NAME" @@ -95,10 +101,21 @@ cp -r "$ROCM_RUNTIME/lib" "$STAGE/d4r/rocm/lib" "$STAGE/d4r/nvcuda.dll" "$STAGE/d4r/zluda/libcuda.so" "$STAGE/d4r/rocm/lib/"* cp "$ROOT/packaging/d4r.ini" "$STAGE/d4r/d4r.ini" cp "$ROOT/packaging/d4r-check.sh" "$STAGE/d4r/d4r-check.sh" -if [[ "$VARIANT" == full ]]; then - : "${D4R_BUNDLE_DLSS:?set D4R_BUNDLE_DLSS}" "${D4R_BUNDLE_NGX:?set D4R_BUNDLE_NGX}" "${D4R_BUNDLE_TEX:?set D4R_BUNDLE_TEX}" - cp "$D4R_BUNDLE_DLSS" "$STAGE/d4r/nvngx_dlss.dll" - cp "$D4R_BUNDLE_NGX" "$STAGE/d4r/ngx/_nvngx.dll" +if [[ "$VARIANT" != clean ]]; then + : "${D4R_BUNDLE_DLSS:?set D4R_BUNDLE_DLSS}" "${D4R_BUNDLE_TEX:?set D4R_BUNDLE_TEX}" + if [[ "$VARIANT" == full ]]; then + cp "$D4R_BUNDLE_DLSS" "$STAGE/d4r/nvngx_dlss.dll" + : "${D4R_BUNDLE_NGX:?set D4R_BUNDLE_NGX}" + cp "$D4R_BUNDLE_NGX" "$STAGE/d4r/ngx/_nvngx.dll" + else + cp "$ROOT/install.sh" "$STAGE/install.sh" + chmod +x "$STAGE/install.sh" + # The downloader is pinned to DLSS 310.7.0: refuse mismatched release inputs. + expected=$(sed -n "s/^DLSS_SHA256=//p" "$ROOT/install.sh") + [[ "$(sha256sum "$D4R_BUNDLE_DLSS" | cut -d' ' -f1)" == "$expected" ]] || { + echo "installer package requires the DLSS DLL pinned in install.sh" >&2; exit 2; + } + fi else printf 'Put NVIDIA'"'"'s NGX runtime, _nvngx.dll, in this folder (see D4R_README.txt).\r\n' > "$STAGE/d4r/ngx/README.txt" fi @@ -136,7 +153,7 @@ build_target() { D4R_PREFER_ACCURACY=0 D4R_ROCM_DIR="$ROCM" D4R_GPU_ARCH="$arch" D4R_NATIVE_FP8="$fp8" "$ROOT/kernels/build.sh" k "$STAGE/d4r/kernels/$folder" >/dev/null D4R_PREFER_ACCURACY=0 D4R_ROCM_DIR="$ROCM" D4R_GPU_ARCH="$arch" D4R_NATIVE_FP8="$fp8" "$ROOT/kernels/build.sh" m "$STAGE/d4r/kernels/$folder" >/dev/null rm -f "$STAGE/d4r/kernels/$folder"/*.resolution.txt # empty LTO notes from clang's -save-temps - if [[ "$VARIANT" == full ]]; then + if [[ "$VARIANT" != clean ]]; then tex_dir="" if [[ -d "$D4R_BUNDLE_TEX/$folder" ]]; then tex_dir="$D4R_BUNDLE_TEX/$folder" @@ -150,7 +167,7 @@ build_target() { done fi fi - [[ "$VARIANT" != full ]] || ensure_l_textures "$STAGE/d4r/kernels/$folder" 0 + [[ "$VARIANT" == clean ]] || ensure_l_textures "$STAGE/d4r/kernels/$folder" 0 python3 "$ROOT/kernels/tools/kernel_manifest.py" "$STAGE/d4r/kernels/$folder" "${DLLS[@]}" # Every release target also gets conservative network and texture variants. Do not copy fast @@ -158,7 +175,7 @@ build_target() { accurate="$STAGE/d4r/kernels/accuracy/$folder" D4R_PREFER_ACCURACY=1 D4R_ROCM_DIR="$ROCM" D4R_GPU_ARCH="$arch" D4R_NATIVE_FP8="$fp8" "$ROOT/kernels/build.sh" k "$accurate" >/dev/null D4R_PREFER_ACCURACY=1 D4R_ROCM_DIR="$ROCM" D4R_GPU_ARCH="$arch" D4R_NATIVE_FP8="$fp8" "$ROOT/kernels/build.sh" m "$accurate" >/dev/null - if [[ "$VARIANT" == full ]]; then + if [[ "$VARIANT" != clean ]]; then accurate_tex="$D4R_BUNDLE_TEX/accuracy/$folder" if [[ -f "$accurate_tex/d4r-accuracy.txt" && "$(cat "$accurate_tex/d4r-accuracy.txt")" == 1 ]]; then for f in "$accurate_tex"/*.hsaco; do @@ -171,7 +188,7 @@ build_target() { D4R_DLSS_DLL="$D4R_BUNDLE_DLSS" "$ROOT/kernels/build.sh" tex "$accurate" >/dev/null fi fi - if [[ "$VARIANT" == full ]]; then + if [[ "$VARIANT" != clean ]]; then ensure_l_textures "$accurate" 1 for f in "$STAGE/d4r/kernels/$folder"/*.hsaco; do # the fast set's native hiluma input kernels have no accuracy build: that set keeps ZLUDA's compile @@ -216,7 +233,7 @@ mkdir -p "$STAGE/d4r/source/patches" cp -r "$ROOT/patches/zluda" "$ROOT/patches/vkd3d-proton" "$STAGE/d4r/source/patches/" ZLUDA_COMMIT="$(git -C "$ZLUDA_SRC" rev-parse HEAD 2>/dev/null || echo unknown)" VKD3D_COMMIT="$(git -C "$VKD3D_SRC" rev-parse HEAD 2>/dev/null || echo unknown)" -# "@clean " / "@full " lines belong to one variant only +# "@clean " / "@full " / "@installer " lines belong to one variant only variant() { sed -n -e "s/^@$VARIANT //" -e '/^@[a-z]* /d' -e p; } file_version() { [[ -f "$1" ]] && strings -el "$1" | grep -A1 '^FileVersion$' | sed -n 2p | tr ',' '.' | tr -d ' '; } sed -e "s/@VERSION@/$VERSION/g" -e "s/@ZLUDA_COMMIT@/$ZLUDA_COMMIT/g" -e "s/@VKD3D_COMMIT@/$VKD3D_COMMIT/g" \