neovide/neovide · error
Failed to create query readback buffer.
Error message
Failed to create query readback buffer.
What it means
In `create_d3d_gpu_context` (src/profiling/d3d.rs:197), the Tracy GPU profiling context creates a readback buffer in a default heap to pull query results back to the CPU. `ID3D12Device::CreateCommittedResource` returned a failure HRESULT, so the code panics via `.expect()`. Typical causes are out of memory, an invalid device, or unsupported heap/resource parameters.
Source
Thrown at src/profiling/d3d.rs:197
let readback_heap_props = D3D12_HEAP_PROPERTIES {
Type: D3D12_HEAP_TYPE_READBACK,
CPUPageProperty: D3D12_CPU_PAGE_PROPERTY_UNKNOWN,
MemoryPoolPreference: D3D12_MEMORY_POOL_UNKNOWN,
CreationNodeMask: 0,
VisibleNodeMask: 0, // TODO: Support multiple adapters.
};
let mut readback_buffer: Option<ID3D12Resource> = None;
device
.CreateCommittedResource(
&readback_heap_props,
D3D12_HEAP_FLAG_NONE,
&readback_buffer_desc,
D3D12_RESOURCE_STATE_COPY_DEST,
None,
&mut readback_buffer,
)
.expect("Failed to create query readback buffer.");
let payload_fence: ID3D12Fence =
device.CreateFence(0, D3D12_FENCE_FLAG_NONE).expect("Failed to create payload fence.");
let command_allocator: ID3D12CommandAllocator = device
.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT)
.expect("Failed to create command allocator");
let command_list: ID3D12GraphicsCommandList = device
.CreateCommandList(
0,
D3D12_COMMAND_LIST_TYPE_DIRECT,
&command_allocator,
&ID3D12PipelineState::from_raw(null_mut()),
)
.expect("Failed to create command list");
(View on GitHub (pinned to ade2d9cda7)
Solutions
- Update GPU drivers and verify the D3D12 device is healthy (no D3D12_ERROR_DEVICE_REMOVED / DXGI_ERROR_DEVICE_REMOVED).
- Check free memory; the readback buffer allocation can fail under VRAM/system memory pressure.
- Disable the gpu_profiling feature if Tracy GPU profiling is not needed.
- Enable the D3D12 debug layer to get the precise HRESULT reason from the debug output.
Defensive patterns
Strategy: fallback
Validate before calling
// before enabling GPU profiling
if !device.is_valid() || device_removed { /* skip tracy_create_gpu_context */ } Try / catch
// keep profiling optional
let result = std::panic::catch_unwind(|| tracy_create_gpu_context(...));
if result.is_err() { eprintln!("GPU profiling unavailable"); } Prevention
- Keep gpu_profiling as an opt-in feature and disable it in production builds.
- Check device health / device-removed HRESULTs before creating profiling resources.
- Keep GPU drivers updated on profiling machines.
When it happens
Trigger: Calling `tracy_create_gpu_context` (which invokes `create_d3d_gpu_context`) when `CreateCommittedResource` for the readback buffer fails — e.g. device removed, E_OUTOFMEMORY, or the D3D12 device was created with debug-layer-detected invalid state.
Common situations: GPU driver crash / device-removed state; running out of VRAM; enabling gpu_profiling on systems with broken or outdated D3D12 drivers; creating the profiling context after the device was already destroyed.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Failed to create payload fence.
- Failed to create command allocator
- Failed to create command list
- Profiling context not initialized for current thread
- Failed to create Direct3D debug controller
AI-assisted analysis of neovide/neovide@ade2d9cda7 (2026-09-06).
Data as JSON: /api/errors/b5add45343c6492b.
Report an issue: GitHub.