Leave the pools as imports for NVIDIA's own driver on Linux in the game itself.

On Linux every driver got shadow storage (copies of guest memory beside it), which exists for amdgpu, where importing guest memory costs the write protection of its pages. NVIDIA's own driver imports without that cost, so there the copies are only the slower path: in Kokiri Forest on 0.7.1 (RTX 4090) imports ran at 51.9 frames a second and the copies at 27.4. Until now only the AppImage's play.sh knew, by setting NX2NAVI_SHADOW=0 when NVIDIA's kernel driver was present at build time, so a game started any other way got the copies, and a PC with that kernel driver whose game ran on another card got imports where it should not. The game now chooses by the driver of the device it runs on, play.sh no longer sets the variable, and NX2NAVI_SHADOW=1 or 0 still decides. The driver is asked when the device is picked, before the storage is chosen.

Windows is unchanged: the device probe here reads "mem: mode mirror" with no shadow storage line, and the shadow line with NX2NAVI_SHADOW=1. The Linux path itself was not run: there is no Linux machine here.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-11 00:12:32 -05:00
parent 08413ab265
commit 4f85f3d59a
4 changed files with 21 additions and 13 deletions

View File

@@ -153,14 +153,11 @@ else
ev step dlss '"state":"skip"'
fi
# play.sh: the environment the game wants on this machine, then the game
# play.sh: starts the game from its own folder. It sets no storage mode: the game leaves shadow storage off for
# NVIDIA's own driver itself (runtime/vk_memory.c mirror_mode), by the driver of the device it runs on.
{
echo '#!/bin/bash'
echo 'cd "$(dirname "$(readlink -f "$0")")"'
if [ -e /proc/driver/nvidia/version ]; then
echo '# NVIDIA: the default shadow storage leaves the 3D world black (issue #72)'
echo 'export NX2NAVI_SHADOW="${NX2NAVI_SHADOW:-0}"'
fi
echo 'exec ./ocarina "$@"'
} > "$OUT/play.sh"
chmod +x "$OUT/play.sh"