Repository navigation
fix(linux): warn when permissions block udmabuf imports - #2111
Merged
Merged
Conversation
Keep the original stderr available when startup redirects the runtime log, so permission failures can explain the slower fallback and point to scoped access fixes. Assisted-by: OpenAI GPT-6 Astra Co-Authored-By: OpenAI GPT-6 Astra <noreply@openai.com>
mooki000
added a commit
to mooki000/Hookshot
that referenced
this pull request
Nov 11, 2026
The start-up check for /dev/udmabuf (NotRexed#2111) runs before the game knows which GPU it has, so it still warns on NVIDIA's driver, where the renderer no longer opens the device at all. The readme now says that the warning can be ignored there, so nobody joins a device group or writes a udev rule for nothing. (Review of NotRexed#2340.) Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linux users can lose much of their frame rate when device permissions prevent Hookshot from using
/dev/udmabuf, without being told how to fix it. On my RX 7900 XT, a matched Kokiri Forest test measured 16.1–16.2 game fps with host-pointer imports versus 36.1 with DMA buffers.What changed
EACCESorEPERM, with the error, slower-import consequence and group/udev access advice. Other open failures keep the existing logging.hookshot_log.txt; writing another line to the redirected stderr alone would not reach the original caller. With unredirected stderr, the warning is logged only once.uaccess, or a dedicated group for service/SSH users. No world-writable device, root game process or automatic permission change.Related: #1000; follows the DMA-import support merged in #448. This does not fix every Linux performance issue or close the tracking issue.
Evidence and tests
Base: upstream main
215ab3dd6536cb21fc67c2e89c31c10a18df555c.Historical hardware evidence: RX 7900 XT / RADV NAVI31, Mesa 26.2.3, Linux 7.2.7, Ryzen 5 7600X. The permission-denied device was
root:kvm 0660. With mesh draws disabled in both cases, the matched DMA run reached 36.1 game fps; reverting toHOS_GUEST_MEMFD=0with the same access grant returned to 16.2. Queue-submit time was 29.10–30.15 ms without DMA and 0.49 ms with it. These are earlier diagnostic runs, not a benchmark of this warning patch or generated-display fps.Regression demonstrated before the change: no warning on stderr.
python -I -B tests/run_all.py udmabuf_warning low_memory_notice: 2 passed. The new test checks EACCES/EPERM, ENOENT/EIO, success, repeated probes, and redirected/unredirected stderr.Compiled and ran the actual warning block plus the production logger against a real mode-000 file: one warning on original stderr and one in the redirected log. No game assets needed.
C fixture: GCC,
-std=c11 -Wall -Wextra -Werror; Ruff andgit diff --check: passed.Full game-free suite:
python -I -B tests/run_all.py --jobs 6 --timeout 1200— 354 passed, 2 failed, 12 skipped, 520 s on Linux.tests/test_finish_output.pyandtests/test_linux_update.pyfail withNameError: name 'a' is not definedin the extractednx2/make_game.pyfinish block; both failures reproduce on untouched upstream at the base SHA above. Skips cover game/GPU/Windows-only checks and unavailable dotnet, PIL and numpy. Earlier runs exposed an unrelatedtests/test_make_game_ngx.pyfailure, reproduced on untouched upstream; upstream fixed it in test: main's source checks pass again after #2061 and #2046 #2068, and this branch was rebased onto that fix before the earlier passing full run.Whole-file
host/hos_main.cClang syntax/type check: passed, using the project's game-free runtime-header generators.Not tested: the patched full game, Windows runtime/build, other GPUs, or applying either persistent udev policy. No new hardware benchmark was run, so no new tested-configurations row is claimed.
Screenshots
Before/after terminal captures of the game-free EACCES fixture, using the same warning code and real logger (not game screenshots):
Before: no output on stderr. After (once, also in
hookshot_log.txt):Both probes run twice; the new stderr warning appears once.
Note:
tests/test_finish_output.pyandtests/test_linux_update.pyalso fail on untouched currentmain(NameError: name 'a' is not defined); they are unrelated to this change.