WIP: Intel GPU fixes: device fault diagnostics, dynamic iGPU budget, hybrid CPU affinity #1569
Closed
Maine774 wants to merge 7 commits from
intel-gpu-fixes into main
pull from: intel-gpu-fixes
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1569
Loading…
Reference in a new issue
No description provided.
Delete branch "intel-gpu-fixes"
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
Three targeted improvements for Intel GPU issues:
1. Enhanced Device Loss Diagnostics for Intel Arc GPUs
device_lost()invk_replay.cppnow callsdevice_fault_report()for Intel (vendorID 0x8086) usingVK_EXT_device_fault2. Dynamic iGPU Texture Budget Based on System RAM
vk_texture.cpp:RX_VK_VRAM_MBoverride3. Intel Hybrid CPU Core Affinity Enhancements
hos_thread.c:HOS_RESERVE_CORE_MASKenv var for manual override/testingTesting
test_cas_loop_ceiling.py✅test_device_lost_exit.py✅ (updated fixture with Intel fault stubs)test_reserved_core.py✅ (updated fixture with hos_log stub)Backwards Compatibility
RX_VK_VRAM_MB,HOS_RESERVE_CORE,HOS_RESERVE_CORE_MASK)Related Issues
Hi @Maine774, heads-up: head
8637526doesn't compile on Windows (llvm-mingw from HookshotBuilder v2.0.12 tools,make_game.py). There are two independent errors:gpu/vk/vk_replay.cpp:device_fault_report()is called (around line 2420 on the PR head) but only defined ingpu/vk/vk_draw.cpp, with no declaration thatvk_replay.cppcan see:A declaration (e.g.
void device_fault_report();) in a header both files include, or invk_replay.cpp, fixes it.host/hos_thread.c: the new code usesbool/true/false(e.g.static bool logged = false;,bool success = false;), but this C file doesn't include<stdbool.h>, and neither doeshos.h/a64.h. Before C23, C has noboolkeyword:Adding
#include <stdbool.h>tohos_thread.c(or usingint) fixes it.I'm interested in the hybrid-CPU affinity part. On an i5-14600KF (6P+8E) game threads wait ~250 ms for a virtual core (#1420 / #995), so I'm happy to test it once it builds.
The three ideas are reasonable (fault info on Intel device loss, a RAM-scaled iGPU texture budget, hybrid-core logging plus an override), but as it stands the head doesn't compile, as BrunoSilvestre00 already reported. I confirmed both errors in the code:
device_fault_report()is defined ingpu/vk/vk_draw.cppand isn't declared invk_internal.h,vk_draw.hor anywherevk_replay.cppcan see. Add a declaration to a shared header.tests/test_device_lost_exit.pydefines its own stub, so it can't catch this.host/hos_thread.cis C and usesbool/true/false(static bool logged,bool success) with no<stdbool.h>. Include it or useint. The new code inpick_reserved_coreis not Windows-only, so Linux hits this too.Smaller points (non-blocking):
budget = std::max(budget, 1024ull << 20)can lift the budget aboveown, which is the driver's limit. Astd::min(own, ...)clamp would be safer.HOS_RESERVE_CORE_MASKwith an unparsable value silently gives mask 0 (no reserved core). Fine for a debug override, but worth a log line.pick_reserved_corecode, so one of the two will need a rebase.Once it builds on Windows and Linux I'm happy to look again.
device_fault_reportisn't declared in this TU (it lives in vk_draw.cpp), so this is an undeclared identifier. Declare it in vk_internal.h or vk_draw.h.This is a C file without
<stdbool.h>, sobool/true/falsedon't compile here (same forbool successfurther down). Include it or useint.Thanks, I'll look into this and get back to you.
I tried this on Linux (Arch, clang 23.1.3, libstdc++ from GCC 16), merged into main
872cb68, to test it on an Intel UHD 770 (Mesa 26.2.5). The headb0bff2bdoesn't compile there:(The line numbers are those of the merge.) They are the seven
std::min(budget, NNNNull << 20)/std::max(budget, 1024ull << 20)calls in the new iGPU budget block. On Linuxuint64_tisunsigned long, so the template cannot deduce one type; on Windows it isunsigned long long, which is why it builds there. Giving the type,std::min<uint64_t>(...)/std::max<uint64_t>(...), compiles with this clang (checked on a two-line file, not yet in a build of the whole branch).One note for testing on Linux Intel: Mesa's ANV on this UHD 770 does not list
VK_EXT_device_fault, so the fault diagnostics have nothing to report on it. I'll run the budget part on the UHD 770 once it builds and post what it shows.Follow-up to my comment above, with the run I said I'd do.
The new head
5b19f5acstill doesn't compile on Linux. The merge of main didn't touch the seven calls, sogpu/vk/vk_texture.cpp(clang 23.1.3, libstdc++, the build's flags) stops at the same place:std::min<uint64_t>(...)/std::max<uint64_t>(...)on lines 3811-3824 fixes it.The budget part on the UHD 770, with that cast fixed locally (
b0bff2bmerged into main872cb68). Same save-load scene into Kokiri Forest as main, 8 minutes, headless, Mesa 26.2.5, 93 GB RAM:vk: integrated GPU texture budget: 6144 MB (system RAM 93 GB, driver allows 6144 MB, reserved 16 GB). Main's is 2560 MB.textures 17667 MB (budget 6144 MB)here,17608 MB (budget 2560 MB)on main), while every allocation of the process together is about 4.9 GB (4884 MB used).create()counts each ASTC texel as the block's 16 bytes, so these textures count 16-144 times their real size. The fix for that is #2288; with it, main counts2241 MB (budget 2560 MB)in the same scene.With native ASTC counted right, a bigger budget on a big-RAM machine would mean something on Intel. Until then this part changes the number in the log line, not what's evicted.
As noted before, the fault report has nothing to call on ANV here (no
VK_EXT_device_fault), and the core selection is Windows-only, so I couldn't test either.