fix(host): a start where Vulkan lists no GPU ends at once, and the window after it says why #2102
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2102
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/no-gpu-start"
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?
Summary
A Linux player got a black window with the game's sound playing and no picture. Their log:
vk: GPU device: the saved card (10de:2d05:0) is not here, novk: device N:line at all, thenvk: no Vulkan 1.3 GPU,pick_device failed,display: the renderer did not start: the window stays black, and the game went on (vi: ... frames presented, 240 fps, nothing drawn). The Vulkan loader listed no GPU: the player was on CachyOS's rt-bore kernel, a real-time (PREEMPT_RT) one, with NVIDIA's driver not loaded. A standard kernel fixed it.Two things made that hard to find, and this changes both:
mainit plays on behind a black window, with its sound, until the player closes it, and only then does the window after it (#593) say what went wrong. Nowrenderer_main(Linux) anddisplay_main(Windows) log the line the crash window reads, flush the log, close the run's marker as a clean end and exit with code 1: the start-failure window comes up right away. On Linux, a close already claimed during startup takes precedence over reporting a startup failure.pick_devicenow logsvk: no Vulkan device (cause <key>): ...when the loader lists nothing. On Linux it asks the PC (gpu/vk/compat/longshot_no_gpu.h, reading/sysand/proc): an NVIDIA card with no other graphics card and complete PCI information: NVIDIA's module not loaded on a real-time kernel (nvidia-rt), not loaded on another kernel (nvidia-unloaded), or loaded with no Vulkan device (nvidia-vulkan). Mixed cards, incomplete PCI information and other cases stay not known (unknown, also all of Windows). The graphics cards' PCI ids go in the line. The crash window reads the line back and says, for the real-time case, that a driver compatibility or loading issue is possible and suggests checking the driver and module logs and trying a supported driver or a standard kernel. A start where devices are listed but none has Vulkan 1.3 keeps its message.The player docs' Linux start section (
docs/user/common-issues.md) gets the real-time kernel case.On
main: start the game with Vulkan showing no device (on WindowsVK_LOADER_VENDOR_ID_FILTER=0x1234, a vendor no GPU has): a black window, the game running behind it, and "Update your graphics driver" once it is closed.Read first:
host/posix/display_sdl.crenderer_main,host/display.cdisplay_main,gpu/vk/compat/longshot_no_gpu.h,host/hos_crash_dialog.h(hos_crash_log_line,hos_crash_cause,hos_crash_cause_text),gpu/vk/vk_main.cpppick_device.See #821, #1682.
Testing
Tested: Windows 11, RTX 5080, NVIDIA 621.24; this PR on
main@049a4a45(with #2098), built withdev.py packand run through the job queue, windowed. The before side is the shared baseeee3e1d5(dev.py rt --empty):display.c,display_sdl.c,pick_deviceand the crash window's causes and texts are the same there as on049a4a45.VK_LOADER_VENDOR_ID_FILTER=0x1234, a vendor no GPU has): before, a black window,vi: 5616 frames presentedafter 30 s, the game running until closed, then the window with "Vulkan didn't start on your graphics card. Update your graphics driver". Here:vk: no Vulkan device (cause unknown): no Vulkan driver lists a GPU,display: the renderer did not start: the game ends, and the window after it says why, exit code 1 in under a second, and the window at once: "Vulkan found no graphics card: no graphics driver with Vulkan is installed or loaded ..." (pictures in a comment).stop: close work done, exit code 0, no window after it.main@d76d202f(#1989, which touches none of this PR's files): the test passes again there.tests/test_no_gpu_start.py(new) fails onmain(the renderer's failure leaves the game running) and passes here, with clang++ 23.1.5 (llvm-mingw) on Windows and gcc 13 on Ubuntu 24.04 (WSL), where the probe reads PCI folders named as Linux names them (0000:01:00.0). With the crash window's cause mapping broken back, it fails again.host/posix/display_sdl.candhost/hos_crash_dialog.cwith gcc 13-fsyntax-only -Wall -Wextraon Ubuntu 24.04 (WSL): no error or warning in them (a broken copy ofdisplay_sdl.cdoes fail, so the check reaches the code). Not compiled on Linux:gpu/vk/vk_main.cpp(no Vulkan headers there); its Linux branch is the one calllongshot_no_gpu_probe("", &why), whose header the test compiles on Linux.mise run test's suite (tests/run_all.py) on Windows, on this branch before its rebase onto049a4a45(#2098, #1767 and #1892 came in; the new test passes again after it): 712 passed, 85 failed, 135 skipped; all 85 fail onmaintoo (run again there, 0 passed), among them the 25 that read this PR's files (listed under Risks);test_crash_dialog.py's log-stage section passes here and onmain, its verdict section fails the same way on both (Windows: a crash record case before the Vulkan ones).Still to test:
VK_LOADER_VENDOR_ID_FILTER=0x1234, expectingvk: no Vulkan device (cause nvidia-vulkan): NVIDIA's module is loaded, but no Vulkan driver lists a GPU; graphics cards 10de:xxxxon a system with only an NVIDIA graphics card and complete PCI information, the game ending at once, and the window naming it (@Beanstalk Linux NVIDIA: start withVK_LOADER_VENDOR_ID_FILTER=0x1234in longshot_env.txt; the game should end at once with "NVIDIA's kernel module is loaded, but Vulkan found no graphics card")linux-cachyos-rt-bore): the player's own case, expectingcause nvidia-rtand guidance to check the driver and kernel module logs and try a supported driver or a standard kernel (by hand: the player who reported it)Measurements
Verdict: fixed: a start with no GPU listed ends at once and says why, instead of a black window with sound; the test fails on
mainand passes here.Setup: Windows 11, RTX 5080, NVIDIA 621.24; windowed start with
VK_LOADER_VENDOR_ID_FILTER=0x1234; the game's log and exit code, and the window after it. Baseline for the game runs: the shared baseeee3e1d5, whose display code,pick_deviceand crash window causes and texts are those ofmain@049a4a45.049a4a45(game runs: baseeee3e1d5)57eb44ef(heada4d79341: the same, rebased)tests/test_no_gpu_start.pyMeasured with this PR on
main@049a4a45. The head is rebased ontomain@d76d202f, whose one new commit (#1989, FSR 4 model selection) touches none of this PR's files: the runs still hold.Risks
/sysand/proc, only when no device is listed. It names an NVIDIA cause only when an NVIDIA card is present, no other graphics card is found and PCI information is complete; anything else stays "not known", with the generic "found no graphics card".maintoo:test_appimage_player_build,test_auto_handheld,test_build_long_paths,test_compile_retry_jobs,test_compile_stops_on_exception,test_crash_dialog,test_crash_record,test_dev_build,test_dev_packs,test_display_startup_failure,test_failed_compile_keeps_objects,test_fpx_sticky,test_game_menu_mouse_buttons,test_lift_cache,test_linux_preflight,test_make_game_ngx,test_menu_text_field,test_mise_build,test_mods_list,test_perf_report,test_prepare_cache_save,test_present_ahead,test_renderer_new_handler,test_renhdrum,test_vfpx_elem.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes on the current head.tests/that reads changed source is updated, not weakened. (None needed a change: those that read these files pass here as onmain, and those that fail on this Windows PC fail onmaintoo,test_crash_dialog.py's log-stage section passing on both.)mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 5080, NVIDIA 621.24, this PR on main
049a4a45(dev.py pack, job queue, windowed). With Vulkan showing no device (VK_LOADER_VENDOR_ID_FILTER=0x1234): 'vk: no Vulkan device (cause unknown)', 'display: the renderer did not start: the game ends ...', exit code 1 in under a second, and the start-failure window at once with 'Vulkan found no graphics card'. Before (baseeee3e1d5): a black window with the game running until closed. A normal start: the RTX 5080 chosen, the game drawn for 75 s, closed with exit code 0 and no window after it.Pictures: Windows 11, RTX 5080, Vulkan showing no device (
VK_LOADER_VENDOR_ID_FILTER=0x1234).Before (base
eee3e1d5): 15 s in, the game running behind a black window, and the window after it once it was closed:After (this PR @
57eb44ef): the game ended in under a second (exit code 1) and this came up at once:57eb44ef41a4d79341bdRebased onto main @
d76d202f(#1989, which touches none of this PR's files): heada4d79341, tests/test_no_gpu_start.py passes again. Linux: the test passes with gcc 13 on Ubuntu 24.04 (WSL), and host/posix/display_sdl.c and host/hos_crash_dialog.c compile there with -Wall -Wextra and no error or warning; the Host code box is ticked.Description: the box for checks that read changed source (none needed a change), and why the runs on
049a4a45hold ond76d202f.WIP: fix(host): a start where Vulkan lists no GPU ends at once, and the window after it says whyto fix(host): a start where Vulkan lists no GPU ends at once, and the window after it says whyCI: Guide screenshots / Guide images and local UI source review fails on main too (
scripts/check_guide_screenshots.py --review-sourceson maind76d202f: 19 issues, settings-graphics.png's sources changed since its reviewed revision; #2095 recaptures it). This PR adds none: its run lists a subset of main's, no file of this PR among them.@review
Recommendation: Request changes. The Windows no-device run shows that the game now exits promptly, but a Linux close during renderer startup can be mistaken for a failure and interrupt cleanup. The Linux diagnosis also states causes more confidently than the evidence supports, and the test does not exercise the renderer’s new diagnostic call.
The change ends a visible game whose renderer cannot start and adds a more specific no-device message. It improves the demonstrated Windows case, but needs a safe close path and more reliable Linux diagnosis.
@fixwill do (7)host/posix/display_sdl.c:215: A player can close the window while the renderer starts: rx_close_asked sets the renderer’s closing flag and performs cache and worker cleanup, while start can return 0 because that flag is set. (more on the line)gpu/vk/compat/longshot_no_gpu.h:88: The probe treats any NVIDIA PCI card plus an absent nvidia module as proof that NVIDIA’s driver caused the failure. (more on the line)host/hos_crash_dialog.h:500: The message says NVIDIA’s driver cannot run on any PREEMPT_RT kernel, but that conclusion does not follow from an unloaded module and NVIDIA’s open kernel modules support real-time kernels in supported configurations. (more on the line)tests/test_no_gpu_start.py:225: The test constructs the diagnostic line by calling the probe directly; it never exercises pick_device. (more on the line)tests/test_no_gpu_start.py:249: This C test selects CXX and forces it into C mode, so a configured CC is ignored both directly and through run_all. (more on the line)tests/test_no_gpu_start.py:217: On Windows the synthetic probe reads the temporary directory through narrow fopen and stat. (more on the line)Guide screenshots / Guide images and local UI source review (pull_request)fails on this head and passes on the base branch: Failing after 37s.Before merging, for the author (1) (a run, a measurement or a decision; it doesn't hold the recommendation)
gpu/vk/compat/longshot_no_gpu.h:64: The reported Linux NVIDIA real-time-kernel failure and the normal Steam Deck or AMD startup have not been exercised in game. (more on the line)Checks: Still running:
CI / Website build and checks (pull_request).More: does it help, other systems, switches, what was read
Does it help: Yes for the tested Windows visible-window case: the author reports that the base continued behind a black window for 30 seconds, while this branch exited with code 1 in under a second and showed the failure window. The reported Linux NVIDIA real-time-kernel case has not yet been run.
Other systems: Linux NVIDIA failure and normal Steam Deck or AMD startup remain untested in game. Headless startup uses a separate path that still ignores renderer failure. Closing a Linux window while startup is in progress can race the new exit with renderer cleanup.
Switches: No runtime switches added, changed or removed. LONGSHOT_NO_GPU_KEYS_ONLY is a compile-time header selector, default undefined.
Reviewed:
a4d79341bdagainstd76d202f51: Read the repository rules, contribution standards, PR template, commits, diff, new header and test, and the affected startup, crash-dialog, renderer and shutdown paths. Skimmed the remaining portions of the large changed code files and existing test runner; did not inspect screenshots or generated files. The optional docs/review-checklist.md and sibling Tooling checkout were absent.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no project code, tests or builds were run. The supplied CI result has a head-only failure that the bot will report separately, and the website check is still running.
Overlaps and merge order: No overlapping pull request established from the supplied material.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -0,0 +61,4 @@}// What the PC says: root "" for its own /sys and /proc, a folder that holds sys/ and proc/ for a test, NULL for nothingstatic inline void longshot_no_gpu_probe(const char *root, LongshotNoGpu *g) {memset(g, 0, sizeof *g);L7 (minor): The reported Linux NVIDIA real-time-kernel failure and the normal Steam Deck or AMD startup have not been exercised in game. Run the stated cases and record the resulting exit, diagnosis and normal startup before merge.
@ -0,0 +85,4 @@}if (d) closedir(d);if (g->nvidia_card)g->cause = g->nvidia_loaded ? LONGSHOT_NO_GPU_NVIDIA_VULKAN : g->realtime ? LONGSHOT_NO_GPU_NVIDIA_RTL2: The probe treats any NVIDIA PCI card plus an absent nvidia module as proof that NVIDIA’s driver caused the failure. On a hybrid laptop using its AMD or Intel GPU, an unused NVIDIA card can be present while a missing or filtered Mesa Vulkan driver is the actual problem; the dialog instead tells the player to install NVIDIA’s driver or change kernels. Treat these observations as possibilities unless the affected device and driver are established, and retain generic troubleshooting for ambiguous systems.
@ -483,0 +497,4 @@return "Vulkan found no graphics card: no graphics driver with Vulkan is installed or loaded. Install or update your ""graphics driver and restart your PC: Longshot needs a graphics card and driver with Vulkan 1.3.";case HOS_CAUSE_NVIDIA_RT:return "NVIDIA's driver isn't loaded: this Linux kernel is a real-time one (PREEMPT_RT), which NVIDIA's driver doesn't "L3: The message says NVIDIA’s driver cannot run on any PREEMPT_RT kernel, but that conclusion does not follow from an unloaded module and NVIDIA’s open kernel modules support real-time kernels in supported configurations. A player with an unrelated installation or module-loading failure is directed to replace their kernel. Describe the detected combination as a possible compatibility issue and give driver-specific troubleshooting; correct the same absolute claim in the Linux documentation and log text.
@ -209,0 +212,4 @@void hos_crash_clean_end(void);hos_crash_clean_end();ExitProcess(1);}L1: A player can close the window while the renderer starts: rx_close_asked sets the renderer’s closing flag and performs cache and worker cleanup, while start can return 0 because that flag is set. This branch then logs a startup failure and exits the process concurrently, potentially interrupting that cleanup and showing a failure dialog for an intentional quit. Coordinate the close and startup threads and let the close path finish when startup was cancelled.
@ -0,0 +214,4 @@compile_c(cxx, tmp / "dialog.c", dialog, ROOT / "host")for name, (files, want) in PCS.items():root = tmp / ("pc-" + name)root.mkdir()L6 (minor): On Windows the synthetic probe reads the temporary directory through narrow fopen and stat. If the temporary path contains characters outside the active Windows code page, Python creates the files but the probe cannot open them, so the test fails on a supported user profile. Use a Windows Unicode-capable file path for the fixture or arrange an ASCII-only temporary root.
@ -0,0 +222,4 @@if not line.startswith("no Vulkan device (cause %s)" % want):raise SystemExit("FAIL: %s: the line does not start with its cause: %r" % (name, line))cards = "1002:744c" if name == "amd" else "10de:2d05" if files else ""if cards not in line or "10de:22eb" in line or "8086:7ae0" in line:L4: The test constructs the diagnostic line by calling the probe directly; it never exercises pick_device. Removing the new probe and log call from vk_main.cpp would still let this test pass, leaving the crash window unable to identify the reported Linux case. Exercise the actual no-device enumeration path with Vulkan stand-ins and assert that its emitted line reaches the dialog.
@ -0,0 +246,4 @@def main():parser = argparse.ArgumentParser(description=__doc__)parser.add_argument("--cxx", default=os.environ.get("CXX", "clang++"))L5 (minor): This C test selects CXX and forces it into C mode, so a configured CC is ignored both directly and through run_all. A machine with its supported C compiler in CC but no usable C++ driver fails or skips the check. Accept and pass the runner’s {cc}, and honour CC for direct runs.
@fix
Recommendation: Approve. The reported NVIDIA real-time-kernel failure and a normal Steam Deck or AMD startup still need in-game verification. The Windows no-device run showed the game exiting promptly with a useful message. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
9b3babba15. I edited its description to match the change.Changed
Not done
eee321b64ais absent from the checkout, so the affected sources and guide could not be compared. The author must review them and update the review hashes.Nothing was built or run: the checks run again on the new head.
Ends a failed renderer startup instead of leaving the game running behind a black window, and adds Linux-specific diagnostic guidance. The probe and startup coordination add code, with the affected Linux hardware paths still awaiting in-game runs.
Before merging, for the author (1) (a run, a measurement or a decision; it doesn't hold the recommendation)
gpu/vk/compat/longshot_no_gpu.h:64: The reported Linux NVIDIA real-time-kernel failure and the normal Steam Deck or AMD startup have not been exercised in game. Run the stated cases and record the resulting exit, diagnosis and normal startup before merge.Checks: they run again on this head (
Guide screenshots / Guide images and local UI source review (pull_request)failed on the last one); a failure shows on the pull request.Also noticed (4; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven for the reported Linux case. On Windows, the author reports that a no-device start changed from 5,616 frames behind a black window over 30 seconds to exit code 1 in under a second with a diagnostic window.
Other systems: Windows no-device and normal starts were reported working. Linux NVIDIA real-time-kernel failure and normal Steam Deck or AMD startup remain untested in game; gamescope exits without a crash window.
Switches: None added, changed, or removed.
Reviewed:
9b3babba15againstd76d202f51: Read the diff, GPU probe and new test; reviewed the relevant startup, crash-dialog and caller excerpts, repository rules, PR template, description and recorded runs. Other changed code files were not read in full; no review checklist file was found.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports prior Windows and Linux fixture results; CI has not run on this head.
Overlaps and merge order: none found
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
erlo68 referenced this pull request2026-11-21 19:20:24 +00:00