agc_driver_bda_device fails on NVIDIA Blackwell (RTX 5090, 621.01): read_bda_span gives the lanes on its dword path other lanes' results #22773

Closed
opened 2026-11-18 08:27:27 +00:00 by zarmstrong · 0 comments
zarmstrong commented 2026-11-18 08:27:27 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by zarmstrong on 2026-11-18T08:27:27Z.


What happens

agc_driver_bda_device fails on every run on NVIDIA Blackwell: AGC graphics: an anchored BDA read differs from the same read through the lookups at anchor 0x7fff12340101 + 0 + (0), 32 bits, 4 dwords. The wrong side is the plain lookup path, read_bda_span, not the anchored read: lanes that take its dword-by-dword path get other lanes' results.

Title, test or build step

ctest agc_driver_bda_device

AnyPS5 commit

main 72cf170a25, no pull requests on top. Also fails on 9b60c84343.

System

Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 5090 (10de:2b85), driver 621.01, WinLibs GCC 15.2.0 r7, Release. Validation layer 1.4.363.

Steps to reproduce

set ANYPS5_REQUIRE_VULKAN=1
set ANYPS5_NO_SHADER_CACHE=1
set ANYPS5_GPU=RTX 5090
set VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation
set VK_LOADER_DEBUG=layer
ctest --test-dir build -R "^agc_driver_bda_device$" -V

Stops after about 0.4 s.

Log

Using "NVIDIA GeForce RTX 5090"
AGC graphics: an anchored BDA read differs from the same read through the lookups at anchor 0x7fff12340101 + 0 + (0), 32 bits, 4 dwords

What was checked

GPU driver result
NVIDIA GeForce RTX 5090 621.01 fails 10 of 10 on 72cf170a25, 10 of 10 on 9b60c84343
Intel UHD Graphics 770 (same machine) 101.6129 passes

The validation layer is inserted in every run and reports no VUID- lines. #21961 and #22441 list the same test failing on main on an RTX 5080 (621.14). An RTX 4080 on 621.01 passed it on 2026-11-15 (#20870), so it looks specific to Blackwell.

Which side is wrong. With a local print of every word that differs, the failing compare is the 64-lane continuing program, read 3 (immediate 0, 32 bits, 4 dwords, all used). The anchor guest + 0x100 is in the 16-byte range that maps to the words buffer (bytes 0xa0 + i). Lane 1 reads 16 bytes at anchor + 1, so its last byte, anchor + 16, is outside the range: the expected result is a4a3a2a1 a8a7a6a5 acabaaa9 00afaead and an unmapped fault at 0x7fff12340111. The anchored read returns exactly that. The plain read returns dword 0 correctly and 0 for dwords 1 to 3:

read 3 (imm 0 bits 32 dwords 4 used 0xf) anchor 0x7fff12340101 lanes 64
lane 1 dword 1 low 0x1 expected 0x00000000 actual 0xa8a7a6a5
lane 1 dword 2 low 0x1 expected 0x00000000 actual 0xacabaaa9
lane 1 dword 3 low 0x1 expected 0x00000000 actual 0x00afaead
lane 22 dword 1 low 0x7fffffff expected 0xa6a5a4a3 actual 0x00000000
lane 22 dword 2 low 0x7fffffff expected 0xaaa9a8a7 actual 0x00000000
lane 23 dword 1 low 0x80000000 expected 0xa7a6a5a4 actual 0x00000000

("expected" is the plain lookup, "actual" the anchored read.) Lane 22 reads an unmapped address, yet its plain dwords 1 and 2 hold what lane 3 reads for its dwords 0 and 1, and lane 23 holds lane 4's, while lanes 1 to 4 get zeros. Which lanes differ changes between runs. The lanes that differ are the ones whose span is not mapped and aligned, so they take read_bda_span's dword loop while the other lanes call load_bda_span.

What changes it, 10 runs each on the RTX 5090:

change result
none fails 10 of 10
APS5_BDA_BYTE_READS=1 (no span read function) passes 5 of 5
load_bda_span without DontInline passes 10 of 10
read_bda_span without DontInline passes 10 of 10
read_bda_dword_bytes without DontInline fails 10 of 10
the dword loop's OpVectorInsertDynamic replaced by four OpSelects fails 10 of 10
#21131's DontUnroll on the byte loop reverted fails 10 of 10
load_bda_span called once before the selection, with a mask of 0 for the lanes that take the fallback passes 10 of 10

So the fault needs load_bda_span called out of line from one arm of read_bda_span's per-lane selection while the other arm loops over calls to read_bda_dword_bytes. The module passes the validation layer's SPIR-V checks, so this looks like a driver bug. Real shaders reach the same function from every multi-dword BDA read with a probe (EmitBdaDwordReads, SpirvMemoryInstructions.cpp, SpirvRuntimeBuffer.cpp), so a wave in which some lanes cross a range end or an unaligned device address can return other lanes' data on Blackwell.

Inlining load_bda_span is not a fix: it puts the loads back in the selection's arm, the shape that 8c04efcfbc moved out of line because it hung drivers 591.86 and 590.48.01 (#3291); the two-selection shape it tried next hung 595.x to 610.x (#4975). The last row keeps load_bda_span out of line with its four loads and no call, and moves only its call out of the selection. I will open that as a PR, with a contract test in BdaContracts.cpp for the call's position; I can only test it on 621.01 here.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6463088090 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/22773). Originally posted by [zarmstrong](https://github.com/zarmstrong) on 2026-11-18T08:27:27Z. --- ### What happens `agc_driver_bda_device` fails on every run on NVIDIA Blackwell: `AGC graphics: an anchored BDA read differs from the same read through the lookups at anchor 0x7fff12340101 + 0 + (0), 32 bits, 4 dwords`. The wrong side is the plain lookup path, `read_bda_span`, not the anchored read: lanes that take its dword-by-dword path get other lanes' results. ### Title, test or build step ctest `agc_driver_bda_device` ### AnyPS5 commit `main` `72cf170a25`, no pull requests on top. Also fails on `9b60c84343`. ### System Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 5090 (`10de:2b85`), driver 621.01, WinLibs GCC 15.2.0 r7, Release. Validation layer 1.4.363. ### Steps to reproduce ``` set ANYPS5_REQUIRE_VULKAN=1 set ANYPS5_NO_SHADER_CACHE=1 set ANYPS5_GPU=RTX 5090 set VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation set VK_LOADER_DEBUG=layer ctest --test-dir build -R "^agc_driver_bda_device$" -V ``` Stops after about 0.4 s. ### Log ```text Using "NVIDIA GeForce RTX 5090" AGC graphics: an anchored BDA read differs from the same read through the lookups at anchor 0x7fff12340101 + 0 + (0), 32 bits, 4 dwords ``` ### What was checked | GPU | driver | result | |---|---|---| | NVIDIA GeForce RTX 5090 | 621.01 | fails 10 of 10 on `72cf170a25`, 10 of 10 on `9b60c84343` | | Intel UHD Graphics 770 (same machine) | 101.6129 | passes | The validation layer is inserted in every run and reports no `VUID-` lines. #21961 and #22441 list the same test failing on `main` on an RTX 5080 (621.14). An RTX 4080 on 621.01 passed it on 2026-11-15 (#20870), so it looks specific to Blackwell. **Which side is wrong.** With a local print of every word that differs, the failing compare is the 64-lane `continuing` program, read 3 (immediate 0, 32 bits, 4 dwords, all used). The anchor `guest + 0x100` is in the 16-byte range that maps to the `words` buffer (bytes `0xa0 + i`). Lane 1 reads 16 bytes at anchor + 1, so its last byte, anchor + 16, is outside the range: the expected result is `a4a3a2a1 a8a7a6a5 acabaaa9 00afaead` and an unmapped fault at `0x7fff12340111`. The anchored read returns exactly that. The plain read returns dword 0 correctly and 0 for dwords 1 to 3: ```text read 3 (imm 0 bits 32 dwords 4 used 0xf) anchor 0x7fff12340101 lanes 64 lane 1 dword 1 low 0x1 expected 0x00000000 actual 0xa8a7a6a5 lane 1 dword 2 low 0x1 expected 0x00000000 actual 0xacabaaa9 lane 1 dword 3 low 0x1 expected 0x00000000 actual 0x00afaead lane 22 dword 1 low 0x7fffffff expected 0xa6a5a4a3 actual 0x00000000 lane 22 dword 2 low 0x7fffffff expected 0xaaa9a8a7 actual 0x00000000 lane 23 dword 1 low 0x80000000 expected 0xa7a6a5a4 actual 0x00000000 ``` ("expected" is the plain lookup, "actual" the anchored read.) Lane 22 reads an unmapped address, yet its plain dwords 1 and 2 hold what lane 3 reads for its dwords 0 and 1, and lane 23 holds lane 4's, while lanes 1 to 4 get zeros. Which lanes differ changes between runs. The lanes that differ are the ones whose span is not mapped and aligned, so they take `read_bda_span`'s dword loop while the other lanes call `load_bda_span`. **What changes it**, 10 runs each on the RTX 5090: | change | result | |---|---| | none | fails 10 of 10 | | `APS5_BDA_BYTE_READS=1` (no span read function) | passes 5 of 5 | | `load_bda_span` without `DontInline` | passes 10 of 10 | | `read_bda_span` without `DontInline` | passes 10 of 10 | | `read_bda_dword_bytes` without `DontInline` | fails 10 of 10 | | the dword loop's `OpVectorInsertDynamic` replaced by four `OpSelect`s | fails 10 of 10 | | #21131's `DontUnroll` on the byte loop reverted | fails 10 of 10 | | `load_bda_span` called once before the selection, with a mask of 0 for the lanes that take the fallback | passes 10 of 10 | So the fault needs `load_bda_span` called out of line from one arm of `read_bda_span`'s per-lane selection while the other arm loops over calls to `read_bda_dword_bytes`. The module passes the validation layer's SPIR-V checks, so this looks like a driver bug. Real shaders reach the same function from every multi-dword BDA read with a probe (`EmitBdaDwordReads`, `SpirvMemoryInstructions.cpp`, `SpirvRuntimeBuffer.cpp`), so a wave in which some lanes cross a range end or an unaligned device address can return other lanes' data on Blackwell. Inlining `load_bda_span` is not a fix: it puts the loads back in the selection's arm, the shape that 8c04efcfbc moved out of line because it hung drivers 591.86 and 590.48.01 (#3291); the two-selection shape it tried next hung 595.x to 610.x (#4975). The last row keeps `load_bda_span` out of line with its four loads and no call, and moves only its call out of the selection. I will open that as a PR, with a contract test in `BdaContracts.cpp` for the call's position; I can only test it on 621.01 here. AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#22773
No description provided.