fix(vk): the presents' own queue is opt-in again: RX_VK_PRESENT_QUEUE=1 #1549
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1549
Loading…
Reference in a new issue
No description provided.
Delete branch "pmwork-personal/Longshot:fix/present-queue-opt-in"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: Windows 11, RTX 5090 (NVIDIA 621.24), the queue choice only (see Testing) · Needs: the tester's RTX 5080 on the first nightly with it; #1491's RTX 5080
TL;DR
Since #1476, NVIDIA's driver 621.24 and newer on Windows put the presents on a GPU queue of their own by default. A tester's
RTX 5080 then lost the GPU seconds after frame generation started, at 2x and 3x, with every maker and V-Sync mode, and at
every start with frame generation saved; with
RX_VK_PRESENT_QUEUE=0the crashes stopped. This PR makes that queueopt-in again, as before #1476:
RX_VK_PRESENT_QUEUE=1turns it on. The cost: with V-Sync Off and a fixed framegeneration multiplier, made frames bunch up again on the screen unless a player sets that line.
Breakdown
another RTX 5080 that looks the same).
placed; Hookshot issue 1161 gave an RTX 4090 a black screen with it, before the fork); #1476 made it the default.
create_devicetakes the compute family only whenRX_VK_PRESENT_QUEUEasks for it, on every PC.=0while thequeue is on, DLSS Frame Gen's exit wait on the queues' own locks); with
=1everything as on main; Linux, AMD and Intel(off already); saves, settings and caches.
game on an RTX 5090 and, by the tester, on his RTX 5080.
the made frames reach the screen under 2 ms after the one before without the queue, 0.1% or less with it; each
present's call to the screen 6.6 ms instead of 1.3 (#1476's runs).
RX_VK_PRESENT_QUEUE=1keeps that where it works.Why
The tester (RTX 5080, NVIDIA 621.24, 1920x1080 at 360 Hz, Reflex On, V-Sync Auto) lost the GPU with frame generation on
from nightly-458 (#1476) on: at 3x (fixed for the overlay's part in #1536), then on nightly-469 at 2x as well, with
Built-in FG under mailbox (5 s after every start, the replay's queue done to its last checkpoint, so the fault was not
there) and with DLSS FG under FIFO; 11 crash and unclean-end records in a day. With frame generation off the queue ran on
his PC for minutes. With
RX_VK_PRESENT_QUEUE=0inlongshot_env.txthis crashes stopped. #1491 (another RTX 5080 on621.24, DLSS FG 2x, HDR) loses the GPU at the start-up logo since nightly-458 ("455 works") and was asked to try
=0.Reported by null (nullifyshot) on Discord, with logs, crash records and the
=0test.See #1476, #1491, #1536, #1362.
How to reproduce
Seen on: Windows 11 build 26300, RTX 5080, NVIDIA 621.24, 1920x1080 at 360 Hz (the tester; nightly-464 and
nightly-469)
Settings and switches: Frame generation 2x or 3x (Built-in FG, or DLSS FG), V-Sync Auto, NVIDIA Reflex On; no
RX_VK_PRESENT_QUEUE; main9af4808fSteps: save Frame generation at 2x and start the game; or in play, set Frame generation to 2x or 3x in the Insert menu.
Expected: the game runs.
Actual:
vk: FATAL: the GPU device was lost, seconds later. WithRX_VK_PRESENT_QUEUE=0, the game runs.What changed
The presents' compute queue is off by default on every PC again;
RX_VK_PRESENT_QUEUE=1turns it on.gpu/vk/vk_main.cppcreate_device: no NVIDIA driver default; the switch decides, by the switches' yes/no rule. Thecomment says why, with the history.
gpu/vk/switches.def:RX_VK_PRESENT_QUEUEis anattemptagain (off on every PC).docs/development.md,docs/design.mdsection 13 rule 5,README.md: opt-in, why, and what it gives on an RTX 5090;rule 6 and the development guide's row say that #1476's and #1496's recorded runs had the queue on (the default then).
tests/test_present_queue_default.py: cuts the queue choice out ofcreate_device, Windows branch included, compilesit and asks which family it takes for NVIDIA 621.14, 621.24 and 630 and AMD, with the switch unset, empty, on and off.
Fails on main: "NVIDIA, the switch unset: family 2, expected -1".
Measurements
Verdict: fixed on the tester's RTX 5080 by the same queue choice (his
=0run); this branch's build was not run onhis PC. The cost on an RTX 5090 is #1476's own numbers, the other way round.
Hardware: the tester's Windows 11 build 26300, RTX 5080, NVIDIA 621.24, AMD Ryzen 9 9900X3D, 61 GB; for the cost, Windows 11
Pro build 26300, RTX 5090, NVIDIA 621.24, AMD Ryzen 7 9800X3D, 64 GB
Scene: the tester's: the start-up screen and Hyrule Market (child), 1920x1080 at 360 Hz, Frame generation 2x and 3x
(Built-in FG, DLSS FG), V-Sync Auto, Reflex On; the cost: Hyrule Market (child), 5120x2160 at 165 Hz with G-Sync, DLSS
Frame Gen 3x, V-Sync Off
Method: the tester's crash reports and logs on nightly-469 (main
9af4808f) without the switch, then his play withRX_VK_PRESENT_QUEUE=0(the queue choice this PR makes the default); the cost from #1476's PresentMon runs (two a side,interleaved:
docs/tested/2026-11-17-present-queue-default-vsync-off-*)Baseline: the tester ran main's nightly with and without the switch, not this branch's build (he builds nightlies only),
and
=0on main is exactly this PR's default; the cost columns are #1476's own before and after, which this PR undoesHow to reproduce: the settings above;
RX_VK_PRESENT_QUEUE=0inlongshot_env.txtbesidelongshot.exefor the Aftercolumn; for the cost, #1476's method (PresentMon 2.x
--process_name longshot.exe --timed 30,DisplayedTime)9af4808f(nightly-469)9af4808f415a8944(queue off, as this PR)Flags and settings
One switch changes its default:
RX_VK_PRESENT_QUEUE.RX_VK_PRESENT_QUEUE=1on=1where it is known to runTesting
Tested:
310e7c9dwithRX_VK_PRESENT_QUEUE=0, Built-in FG 2x, 3x and 4x at V-Sync Auto (mailbox), the start-up screen and the title, about2.5 minutes: no device lost (
docs/tested/2026-11-17-overlay-frees-title-main-pq0-pmwork-personal-run01.md); and thetester's RTX 5080 on nightly-469 with
RX_VK_PRESENT_QUEUE=0: no crash.tests/test_present_queue_default.pypasses here and fails on main.python -I -B tests/run_all.pyon the branch beforeits last rebase (aa1bf65e, Windows, llvm-mingw clang 23): 665 passed, 55 failed, 50 skipped; each of the 55 also fails
on main (the newest two, test_capture_readback_visibility and test_present_source_crop, run on main's tree here; none
reads a file this PR changes).
Not testable by hand: the tester's RTX 5080 and #1491's.
Not tested: this branch's own build in the game (the queue choice is the one above); Linux, AMD and Intel (off before
and after).
Must be tested:
RX_VK_PRESENT_QUEUE, Frame generation 2x and 3x, a startand a few minutes in play, expecting no device lost (by hand: the reporter).
device lost (by hand: the reporter, asked on the issue).
Risks
What could break: frame generation's pacing with V-Sync Off on cards where the queue worked (an RTX 5090): made frames
bunch on the screen again unless
RX_VK_PRESENT_QUEUE=1is set. Stability: none known; this is main's path before #1476.Turning it off:
RX_VK_PRESENT_QUEUE=1brings the queue back, per PC.Compatibility: Nothing changes: saves, longshot_options.ini, caches and the vk ABI as before.
Issues
See #1476, #1491, #1536, #1362
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.mainand passing here.🤖 Generated with Claude Code
Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 [email protected]
Tested in game: This branch's own build was not run in the game. The queue choice it makes the default (the presents on the replay's queue, as RX_VK_PRESENT_QUEUE=0 on main) was: Windows 11 Pro 26300, RTX 5090, NVIDIA 621.24, 5120x2160 at 165 Hz, main
310e7c9dwith RX_VK_PRESENT_QUEUE=0, Built-in FG 2x, 3x and 4x at V-Sync Auto (mailbox), the start-up screen and the title for about 2.5 minutes: no device lost (docs/tested/2026-11-17-overlay-frees-title-main-pq0-pmwork-personal-run01.md). And by the reporter: RTX 5080, NVIDIA 621.24, Windows 11 26300, nightly-469 with RX_VK_PRESENT_QUEUE=0, frame generation on: no crash, where without it the GPU was lost at 2x and 3x.