fix(vk): the presents on their own compute queue again by default with NVIDIA's driver 621.24 and newer on Windows #1476
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1476
Loading…
Reference in a new issue
No description provided.
Delete branch "pmwork-personal/Longshot:fix/present-queue-default"
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: medium · Tested on: Windows 11, RTX 5090 (NVIDIA 621.24) · Needs: Windows with an RTX 40 (Test Farm), an RTX 4090 most of all
TL;DR
With frame generation, frames meant to reach the screen evenly still arrived in bunches: each one waited on the GPU behind
the game's next frame. This PR gives them a GPU queue of their own again, by default with NVIDIA's driver 621.24 or newer
on Windows. On an RTX 5090 at V-Sync Off and 3x, frames shown under 2 ms went from a third to none, and each frame reached
the screen about 5 ms sooner. The queue was turned off in v2.0.9 after one RTX 4090 on an older driver had a black screen
with it, so older drivers keep the old path, and the Test Farm checks RTX 40 cards before this merges.
Breakdown
setting.
so frames that #1362 presents at their own times still reach the screen together.
before v2.0.9; the switch follows the yes/no rule; the device-lost message names the way back.
settings and caches.
present's call to the screen 6.6 to 1.3 ms; a new check that fails on main; the full suite as on main.
RX_VK_PRESENT_QUEUE=0turns it off.Why
With a fixed frame generation multiplier, each made frame should stay on the screen for its share of the game's frame.
Since #1362, V-Sync Off presents them at those times, but each present still sits on the replay's queue behind the game's
next frame, so they leave the GPU together: a third of the frames are on the screen under 2 ms, which looks like no frame
generation at all. The same wait pairs the frames at 2x under FIFO (6 ms, then 11 ms). A queue of their own was the default
with NVIDIA's driver before v2.0.9; it was turned off for Hookshot issue 1161 (before the fork) and never turned back on.
See #1442, #315.
How to reproduce
Seen on: Windows 11 Pro build 26300, RTX 5090, NVIDIA 621.24
Settings and switches: V-Sync Off, Frame generation 3x by DLSS FG (Auto), Frame pacing Off; main
415a8944Steps: in play, turn the camera at an even speed; for numbers, PresentMon on
longshot.exe, theDisplayedTimecolumn.Expected: each frame on the screen about a third of the game's frame (5 to 7 ms at ~57 fps).
Actual: a third of the frames under 2 ms (p10 1.0 ms), others over 13 ms.
What changed
The presents' own compute queue is the default again with NVIDIA's proprietary driver on Windows, from driver 621.24 on,
where it was measured; anything else keeps the replay's queue unless
RX_VK_PRESENT_QUEUE=1asks for it.gpu/vk/vk_main.cppcreate_device:wantis NVIDIA's proprietary driver withdriverVersionat least 621.24(
kPresentQueueNvidia); an older NVIDIA driver logs why it stays off.RX_VK_PRESENT_QUEUEfollows the switches' yes/norule (
env_value_off: unset or empty is the default; 0, false, off or no is off; anything else on), soonno longerreads as off. The comment says why, with the history.
gpu/vk/vk_replay.cppdevice_lost: while the presents are on their own queue, the fatal message namesRX_VK_PRESENT_QUEUE=0and asks for the GPU and driver.gpu/vk/vk_dlss.cppdlss_fg_close: the exit's 2 s wait also waits for the presents' own queues' locks: a present onthem lets
dev.present_mugo while it runs, sodevice_wait_idle_lockedcould wait on them with no end at the exit.gpu/vk/switches.def:RX_VK_PRESENT_QUEUEishw(it follows the driver); docs/development.md, design.md section 13rule 5 and the README say so, and what to do on a black screen or a lost GPU.
tests/test_present_queue_default.py(new, fails on main): the default, the version floor, the switch's rule, the rows,the device-lost text and the exit wait.
Measurements
Verdict: better. V-Sync Off 3x: frames on the screen under 2 ms 33.0-33.7% to 0.0%, their times' sd 4.7 to 1.05-1.30
ms, each present's call to the screen 6.5-6.7 to 1.3 ms. With #1442 at V-Sync Auto 2x, the 6/11 ms pairs go: 8.3-8.4 ms each.
Hardware: Windows 11 Pro build 26300, RTX 5090, NVIDIA 621.24, AMD Ryzen 7 9800X3D, 64 GB
Scene: Hyrule Market (child), the tester's saved spot; 5120x2160 at 165 Hz with G-Sync, fullscreen, DLAA, DLSS Frame Gen
3x (DLSS-G made the frames), Reflex On + Boost, V-Sync Off, frame rate cap Uncapped
Method: main
415a8944and this branch as it was first committed (b897bc79: the queue on with NVIDIA's driver; the review'schanges since, the 621.24 floor, the switch's rule, the exit wait and the device-lost text, change no frame on a 621.24
driver), each a
dev_packs.pypack on one base (nightly-396 @7887c497); a warm-up of each, then main and the branch inturn, two runs a side; the control bridge turns the camera with the right stick (60 degrees a second) for 30 s; PresentMon
2.3.0 on
longshot.exefor 30 s. Each run's number shown. The D2 runs are #1442 (273f5d28) withRX_VK_PRESENT_QUEUE=1,against the same build without it from earlier sessions that day. Main
7b229f66is merged in since (6d0e72dc), withoutnew runs: of its commits after
415a8944only #1442 changes the presents' path (vk_framegen.cpp, vk_replay.cpp,vk_main.cpp, vk_dlss.cpp, vk_reflex.cpp), and it is the V-Sync On pacing the D2 runs already ran with, so the numbers hold.
How to reproduce: the settings above, a save at a spot to turn the camera, PresentMon 2.x
--process_name longshot.exe --timed 30 --terminate_after_timed --output_file <csv>; frames under 2 ms and the sd fromDisplayedTime, the call tothe screen as
DisplayLatencylessCPUBusy. Rows:docs/tested/2026-11-17-present-queue-default-*.md.415a8944DisplayedTimep10 / p50 / p90, msDisplayedTimesd, msRX_VK_PRESENT_QUEUE=1DisplayedTimep10 / p50, msDisplayedTimesd, msFlags and settings
One switch changes its default:
RX_VK_PRESENT_QUEUE.RX_VK_PRESENT_QUEUE=1on, byatoi)=0for a black screen or a lost GPUTesting
Tested:
side), the log's
presents on a queue of their own, and, with #1442, V-Sync Auto 2x twice. The queue was also on (byswitch) in 8 recorded runs and a play session on 2026-11-16 and 17 (
docs/tested/*fg-pacing*present-queue*) and twolatency runs for #1442: no lost device, no black screen.
python -I -B tests/run_all.pyon6d0e72dc(Windows, llvm-mingw): 653 passed, 52 failed, 48 skipped; main7b229f66onthis PC: 650 passed, 54 failed. None fails here that fails not on main: the files that differed between the two runs
(
test_finish_output,test_longshot_ctl,test_memtour) pass alone on both, andtest_fastfp_fma,test_fpx_stickyand
test_spawn_emitfail alone on both.tests/test_present_queue_default.pypasses here and fails on main. The gamebuilds from
6d0e72dc(adev_packs.pypack on nightly-396).Not testable by hand: Hookshot issue 1161's black screen: I have no RTX 4090 and no 621.14. The device-lost message,
the 621.24 floor (older drivers stay off) and the Test Farm's RTX 40 run stand in for it.
Not tested: NVIDIA drivers between 621.14 and 621.24 (they stay off: the floor); AMD, Intel and Linux (unchanged).
Must be tested:
RX_VK_PRESENT_QUEUE=1(the queue on whatever the driver), Hyrule Market withframe generation 2x by DLSS FG, V-Sync Off and On, against main; expecting no lost device, crash or black screen and fps
as main (Test Farm: @Beanstalk below)
RX_VK_PRESENT_QUEUE=1for a few minutes, expecting no black screenand no lost GPU (either is issue 1161 back) (by hand: asked in #agent-updates; what to look at: the screen, and the log's
device-lost line)
Risks
What could break: a black screen or a lost GPU with the presents on their own queue, as on Hookshot issue 1161's
RTX 4090 with NVIDIA's 621.14 (a driver now below the floor). Only NVIDIA's driver 621.24 and newer on Windows changes.
Turning it off:
RX_VK_PRESENT_QUEUE=0inlongshot_env.txt; the device-lost message says so.Compatibility: Nothing changes: saves, longshot_options.ini, caches and the vk ABI as before.
Issues
See #1442, #315
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.docs/tested/for each new measured run (format indocs/tested-configurations.md).mainand passing here.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 5090, NVIDIA 621.24: Hyrule Market, V-Sync Off, Frame generation 3x by DLSS FG, main
415a8944and this branch in turn, two 30 s camera turns a side: the log says presents on a queue of their own; frames on the screen under 2 ms 33% on main, 0.0% here (PresentMon); no lost device or black screen@Beanstalk windows, nvidia, gpu-rtx-40xx: compare main with this PR in child Hyrule Market, Frame generation 2x by DLSS FG, V-Sync Off and V-Sync On, about 30 s each, with RX_VK_PRESENT_QUEUE=1 on the PR's side (so the presents' own queue is used whatever the driver: the PR's default starts at NVIDIA 621.24). The PR fails on a lost device, a crash, a black screen, or fps more than 10% under main. Please take the picture after the stick is let go, with the camera still. Also windows amd and linux amd: the PR changes nothing there (the default stays off), one short run each as a crash check.
@Beanstalk Please compare main and this PR on Windows with an NVIDIA RTX 40-series GPU, preferably an RTX 4090. In child Hyrule Market, run DLSS Frame Generation at 2x with V-Sync Off and again with V-Sync On, about 30 seconds for each setting. Set RX_VK_PRESENT_QUEUE=1 on the PR side so the dedicated queue is exercised on every driver. Flag device loss, a crash, a black screen, or FPS more than 10% below main. Also run a short crash check at default settings on Windows AMD and Linux AMD. Report pass/fail and summary metrics only.
Beanstalk test farm · an earlier run: commit
a2d0d3b(the newer results are in a comment below)Commit
a2d0d3b· tier reviewed · approved by futondestroyer · dashboardWhat will be tested · AI plan (
gpt-6.1-terra)The plan compares main and the PR in child Hyrule Market with 2x frame generation for 30 seconds each with V-Sync off and on, then runs a short default-settings crash check. All scenarios run on each target, and the present-queue switch is forced on both sides because the plan cannot set this existing switch on the PR side alone. Crashes, device-loss logs, major screenshot differences, or FPS more than 10% below main fail; the screenshots check for a black screen. The RTX 40-series target must wait for a matching Windows tester, and DLSS is not built on the farm, so the requested DLSS-specific coverage cannot be guaranteed. No tester online now matches windows+nvidia+gpu-rtx-40xx: that target waits for one.
2or1.RX_VK_PRESENT_QUEUE=1), then teleport to Market, measure market for 30 s (after 5 s warm-up), take the picture market to compare with main; 1 run on each side for each of 2 cells (1 game start a run).Started at 22:49 UTC.
Estimate: done in about 25 min, from the queue and the testers online now; some jobs can't start yet.
AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7vsync=2vsync=2vsync=2vsync=1vsync=1vsync=1Measurements · linux+amd
Verdict: fail on linux+amd (1/1 report):
market-frame-generation market.fps_mean.min_delta_pct (-15.2%)failed.Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAMScene: market-frame-generation, from a new save (frame_pacing=0, frame_generation=2, frame_generation_by=0, RX_VK_PRESENT_QUEUE=1); default-crash-check, from a new save; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); market-frame-generation: 1 game start a side, market 30 s after 5 s warm-up; default-crash-check: 1 game start a side, forest 10 s after 5 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)415a894a2d0d3bvsync=2· market · frame ratevsync=2· forbidden log linesvsync=1· market · frame ratevsync=1· forbidden log linesFlags and settings
vsync2,1Markdown for the PR description
7b229f66into fix/present-queue-default fb057a1fe3Beanstalk test farm
Commit
6d0e72d· tier reviewed · approved by llun · dashboardWhat will be tested · AI plan (
gpt-6.1-terra)The plan compares main and the PR in child Hyrule Market with 2x built-in frame generation, forcing the dedicated present queue on the PR. It tests V-Sync on and off because both presentation paths can be affected, measuring FPS and frametime and comparing still images for black screens. Crashes, device loss, a substantial image difference, or FPS more than 10% below main fail the plan. It takes about 25 minutes per tester and waits for a Windows RTX 40-series PC; DLSS Frame Generation and display-level pacing cannot be tested on the farm. No tester online now matches windows+nvidia+gpu-rtx-40xx: that target waits for one.
1or2; RX_VK_PRESENT_QUEUE1(PR only).Done (started 16:07 UTC). Comment
@Beanstalkto run it again.vsync=1, RX_VK_PRESENT_QUEUE=1 (PR only)vsync=2, RX_VK_PRESENT_QUEUE=1 (PR only)Main
7b229f66merged in (fb057a1f, a merge, no force-push), plus three small fixes from a cold review (6d0e72dc):vk_main.cppand the same lines in the README anddocs/development.md. The code is this PR's; the comment keeps #1442's V-Sync On numbers for the queue; the docs keep#1442's FIFO text for the timeline and main's 4x figure.
RX_VK_PRESENT_QUEUE=1turned the queue on (then the log said both "on thereplay's queue" and "on a queue of their own"). It now comes only with the switch unset.
device_lost's text is in a local array: it can run on several threads at once, and a static buffer could mix twomessages.
docs/development.mdsays which case logs why the queue is off (an NVIDIA driver older than 621.24).Checks: the full suite on
6d0e72dcfails nothing that main7b229f66does not fail (the differing files pass alone onboth),
test_present_queue_defaultpasses, and the game builds. The measurements hold: of main's commits since415a8944only #1442 changes the presents' path, and the D2 runs already had it.@Beanstalk