Repository navigation
Runtime: recreate host-transfer textures the driver gives no memory type - #3077
gustavorafaelschmidt wants to merge 1 commit into
Conversation
|
Independent Windows / tier-2 NVIDIA GPU confirmation of PR #3077 at exact head
This independently covers the newer NVIDIA/tier-2 regression path not measured in the original GTX 1050 Ti report. The Pascal driver condition itself is not reproducible on this hardware; it was covered by the PR's forced branch. AI-assisted independent validation. |
0xTehuti
left a comment
There was a problem hiding this comment.
Hardware Certification Pass: Turing (RTX 2070 SUPER)
- Device: NVIDIA GeForce RTX 2070 SUPER (TU104, 8192 MB VRAM, Turing)
- Driver: NVIDIA 595.79.0.0 (Vulkan 1.4.329)
- Host: Windows 11 Pro x64 (Build 26100)
- Toolchain: MSVC 2022 Community x64 (
19.44.35225) + Ninja 1.13 + CMake 4.4 - Validation Layers: Khronos Validation Layers enabled (
LEONIDA_VK_VALIDATION=1)
Test Execution & Results
d3d12_vulkan_device: PASSED (10.94s)d3d12_r9g9b9e5_uav: PASSED (0.32s)
Total: 2/2 tests passed (100%).
Verified on physical hardware: The CPU texture copy fallback path (force_host_transfer_retry) recreates the texture cleanly without VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT when memoryTypeBits == 0, switching cleanly to the staging copy path with zero validation layer violations or E_OUTOFMEMORY errors on NVIDIA Turing.
LGTM.
|
Independent Windows 11 test of PR head
The forced retry logged formats 37 and 133 on both GPUs. This exercises the simulated no-memory-type path; it does not establish that either driver naturally returned Scope: built and ran the |
|
Tested b161ec5 (merged onto main 1628210) on NVIDIA GeForce RTX 4060 Ti, driver 610.88 (32.0.16.1088), Windows 11 26200, MSVC 14.51.36231 (VS 2026), Vulkan SDK 1.4.363.0: pass This is a resource heap tier 2 host whose driver gives host-transfer images a memory type, so it covers the unchanged side of the PR and the forced retry.
AI-assisted (Claude). |
|
Pascal confirmation of #3077 at head
* This is the first Pascal run other than the author's GTX 1050 Ti, and it confirms the Two follow-ups:
AI-assisted (Devin); the tests were run by me on my PC. |
b161ec5 to
51067e7
Compare
On a GTX 1050 Ti (NVIDIA 582.78) a texture in a CPU-visible heap is created with VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT, because the driver reports HOST_IMAGE_TRANSFER for the format, and vkCreateImage succeeds, but vkGetImageMemoryRequirements returns memoryTypeBits = 0, so CreateCommittedResource returned E_OUTOFMEMORY. The Vulkan SDK 1.4.363 validation layer reports nothing. create_texture now destroys the unbound image, checks support again and makes it without host-transfer usage; the CPU copies take the existing staging path. A failed vkCreateImage now leaves image_ null. VulkanDeviceInfo::force_host_transfer_retry (tests only) forces that branch. d3d12_vulkan_device_test and d3d12_subresource_copy_test run their CPU copies through it as a third path. The host's native D3D12 on that GPU is resource heap tier 1 and refuses heaps without DENY flags. compare_heap_neighbours compares such cases as buffers-only heaps on a tier 1 host. compare_placed_reserved compares its placed cases with WARP there (create_warp_host) and keeps the host's own adapter for the reserved and committed ones, and the D3D-90 castable scenario passes a tier 1 host over for WARP, saying so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51067e7 to
2612b15
Compare
|
Thanks @ray3242. Your GTX 1060 run is the second Pascal card, and it found something I had missed. Rebased on main aa2988c. New head: 2612b15. It merges cleanly into the current main 03b09a0 too.
You offered to rerun the full suite on the GTX 1060, and that would help. The new head is the one to test. AI-assisted (Claude Code). |
|
AMD/Linux check of the rebased head under Wine and Proton: the forced retry passes, and the PR adds no failures. Setup: CachyOS Linux, Ryzen 7 7700X iGPU (RDNA2, RADV, Mesa 26.3.1,
RADV gives these images a memory type, so this exercised the test switch only, not a driver returning |
|
Tested 2612b15 on RTX 5090, 621.24, Windows 11: pass. Built the three texture tests this touches ( |
|
Windows + GPU check: NVIDIA GeForce RTX 5080 (driver 621.01) + AMD Radeon 610M iGPU (driver 32.0.13018.6), Windows 11, MSVC (VS BuildTools 18) + Ninja, RelWithDebInfo, Vulkan SDK headers fetched. Tested head Build: clean, 363 targets. Targeted (the PR's host-transfer-texture recreate path),
Full suite (
The PR's unstable CI state did not reproduce locally. Synthetic fixtures only, no game files. AI-assisted (opencode); runs on my machine. |
|
Tested 2612b15 merged with main 03b09a0 on Windows 11 with two GPUs (MSVC 14.51): built
Negative control: current main (03b09a0) built the same way, same machine, same GPU: |
There was a problem hiding this comment.
Tested 2612b150 on Linux with Wine 10.0, llvmpipe (Mesa 25.0.7), clang-cl 21 and Khronos synchronization validation.
d3d12_vulkan_device_testandd3d12_r9g9b9e5_uav_testexited 0. The first test passed host image copy, staging copy and forced retry. The retry ran for formats 37 and 133.- With Wine's built-in D3D12 available,
d3d12_subresource_copy_testexited 1. The 17 comparison mismatches and the fourvkGetImageSubresourceLayout-arrayLayer-01717validation error headers matched a separate build ofmainatd0835dd9line for line. - With
WINEDLLOVERRIDES="d3d12="for this executable, the exact PR test exited 0 and ran all 117 steps on each of the three Leonida paths. In a second run with local logging added to the test, the 117 step names, return codes and readback hashes matched across the three paths. The two standalone tests and the shim-only runs had zero validation errors.
The combination with #4362 (head 4e028a61) also builds cleanly. With normal Wine DLL resolution, #4362's host guard let d3d12_subresource_copy_test run all three paths and exit 0, with zero validation errors.
This exercises the synthetic retry on llvmpipe. The intermittent RTX 4080 SUPER crash still needs a hardware check. AI-assisted. Synthetic test data only.
|
On main d0835dd (no #3077 changes) d3d12_vulkan_device and d3d12_copy_xfmt also exit 0xC0000005 on the RTX 4080 SUPER, but only when 8 copies run at once with CPU load: 6 of 24 and 12 of 24 runs, 0 of 2 alone. So a crash of this kind already exists on main; this PR's 5 of 9 on a single instance may be the same crash made more likely, or a different one, and I did not test this branch. My stack walk had no function names, so I can't say whether the stacks match. Details: #4571 (comment) |
|
@kapitche thanks for the RTX 4080 SUPER runs and for the follow-up control. Since main (d0835dd) shows the same 0xC0000005 in The fix itself is moving to #4682 (same change plus the allocation-failure branch) with this PR's test hook, and the heap-tier part is covered by #5000 (D3D-504), so I've marked this PR as draft and will close or reduce it once those land. AI-assisted (Claude Code). |
…staging fallback Ported from @gustavorafaelschmidt's ItsNotRexed#3077 commit 2612b15 (author credited below). With their go-ahead on ItsNotRexed#4682, keep one fix for both the empty-mask driver case and the allocation-failure case this PR already handled: - VulkanDeviceInfo::force_host_transfer_retry (tests only) forces the no-memory-type branch on any GPU, so d3d12_vulkan_device_test and d3d12_subresource_copy_test run their CPU copies through a third path. - create_image() is a lambda that leaves image_ null after a failed create (the handle is undefined on failure and ~Resource destroys any non-null one), and log_once reports when the fallback fires. - After dropping host-transfer usage, check_image_support is re-run before the image is made again; this PR's allocation/bind-failure retry is kept alongside it. - docs/d3d12_vulkan.md and docs/testing.md record the Pascal measurement and the tier-1 host note. The tier-1 heap/WARP comparison changes in ItsNotRexed#3077 are not part of this port: they belong to D3D-504 (ItsNotRexed#5000). Tests on GTX 1060 / 582.78: both executables built with MSVC 19.44; d3d12_subresource_copy_test OK with all three paths (109 compared steps, 0 mismatches each); d3d12_vulkan_device_test's three CPU-copy paths matched, with only the known pre-existing tier-1 heap_mismatches assert (D3D-504) still failing. No game data. AI-assisted (OpenCode). Original commit by Gustavo Rafael Schmidt <204491080+gustavorafaelschmidt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed as a new D3D item: claim. No item ID assigned yet.
What and why
On a GTX 1050 Ti (NVIDIA 582.78, Windows),
d3d12_vulkan_deviceandd3d12_r9g9b9e5_uavfailed. The cause:VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT, because the driver reportsVK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXTfor the format.vkCreateImagesucceeds, butvkGetImageMemoryRequirementsreturnsmemoryTypeBits = 0, soCreateCommittedResourcereturnedE_OUTOFMEMORY.@ray3242 confirmed the same failure and the fix on a GTX 1060 6GB with the same driver. They also found that
d3d12_subresource_copy, added on main after this branch, fails on Pascal for the same reason.Changes
Resource::create_texture(runtime/shims/d3d12_vulkan_device.cpp): when a host-transfer image gets no memory type, the image is destroyed while it is still unbound and unregistered.check_image_supportruns again and the image is made without host-transfer usage. From then on the CPU copies take the staging path that already exists. If the recreated image still gets no memory type, that is logged. A failedvkCreateImagenow leavesimage_null, because the spec leaves the output handle undefined and~Resourcedestroys any non-nullimage_. Main'sdevice_.share(info)(concurrent sharing) runs once before the first create, so the recreated image keeps it.VulkanDeviceInfo::force_host_transfer_retry(runtime/shims/d3d12_com.h, tests only): forces that branch on any GPU.d3d12_vulkan_device_testandd3d12_subresource_copy_testrun their CPU copies through it as a third path, "host image copy refused by the driver". Ind3d12_subresource_copy_testthat path is compared step by step with the host runtime.d3d12_vulkan_device_test): this GPU's native D3D12 is resource heap tier 1 and refuses heaps without DENY flags (E_INVALIDARG). The layer accepts them, as the console does.compare_heap_neighboursnow holds heap descriptions and derives "mixed" from the DENY flags. On a tier 1 host each mixed case is compared as a buffers-only heap, so alignment, size and heap properties are still checked. All 8 match the host on the 1050 Ti.compare_placed_reserved(from main) places its placed cases in a heap without DENY flags, so on a tier 1 host each one answeredE_UNEXPECTEDand the test failed after the rebase. On a tier 1 host those 53 cases are now compared with WARP, and the test prints why. The reserved and committed cases need no heap, so they are still compared with the host's own adapter. The WARP device comes from the newcreate_warp_host, which the D3D-90 castable scenario now uses too, in place of its own copy. It also restores aLEONIDA_HOST_ADAPTERvalue of any length (the old 128-byte buffer deleted a longer one).docs/d3d12_vulkan.md(WriteToSubresource/ReadFromSubresource) and a "Known problems" row indocs/testing.md.Tested
GTX 1050 Ti, NVIDIA 582.78, Windows 11, MSVC 14.44 (
/W4, no warnings in the build). Rebased onupstream/mainaa2988c. Built withscripts/build_runtime.ps1(453/453), withLEONIDA_VK_VALIDATION=1:d3d12_vulkan_device: passes.d3d12_subresource_copy: passes (it failed on main on this GPU). On each of the three paths, 109 steps are compared with the host with 0 mismatches, and 8 are not compared, as on main.d3d12_r9g9b9e5_uav: passes with 0 validation errors.ctest: 153/153 passed, with 8 skipped and 1 disabled, as on main.AI-assisted (Claude Code).
🤖 Generated with Claude Code