BindTemporaryResource hangs on new IDMLDevice after prior device removal during operator initializer dispatch
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- machine-learning
Research direction
Start by running the documented reproduction sequence with DirectML 1.15.4, focusing on device removal during operator initializer dispatch and the later BindTemporaryResource call. Compare it with device removal during inference, which does not reproduce the hang. Done means identifying the cause of the CPU deadlock and verifying that BindTemporaryResource returns on the newly created device.
Written by the indexing model from the issue text.
Description
Summary
IDMLBindingTable::BindTemporaryResource with a non-null buffer deadlocks CPU-side (never returns, no exception, no error HRESULT) on a freshly-created IDMLDevice when a prior IDMLDevice in the same process experienced device removal during operator initializer dispatch.
The deadlock is conditional on the cause of the prior device removal: device removal during inference does NOT cause this hang on the revival device. Only device removal during the initial operator initializer dispatch poisons subsequent device creation in the same process.
Environment
- DirectML.dll version: 1.15.4
- OS: Windows 11 Pro Version 25H2 (OS Build 26200.8117)
- GPU: NVIDIA RTX 4060 Ti 16GB
- GPU driver version: 595.97
- D3D12 feature level: 12 (12_2)
Reproduction Conditions
The deadlock requires all three of the following:
- A prior
IDMLDevicein the same process experienced device removal (GetDeviceRemovedReasonreturnsDXGI_ERROR_DEVICE_HUNG/0x887A0005) during anIDMLOperatorInitializerdispatch - A new
IDMLDeviceis created viaDMLCreateDeviceafter the prior device's removal (the underlyingID3D12Deviceis still alive — only the DML device died) - A binding table is created on the new device for an
IDMLOperatorInitializerwhoseGetBindingProperties().TemporaryResourceSize > 0, andBindTemporaryResourceis called with a non-nullDML_BUFFER_BINDING
When all three hold, BindTemporaryResource does not return. The calling thread blocks indefinitely.
Reproduction Sequence
// 1. First IDMLDevice runs a 2225-op operator initializer.
// The dispatch's ExecuteCommandLists returns success and the wait fence advances,
// but GetDeviceRemovedReason reports 0x887A0005 immediately afterward.
// (Specific model: RAFT optical flow, 2225 ops, tempSz=50,323,456 bytes,
// 8 persistent-buffer Conv ops at persistSz=86,528 each.)
// 2. Create new IDMLDevice on the same (still-alive) ID3D12Device
ComPtr<IDMLDevice> revivalDml;
DMLCreateDevice(d3d12Device.Get(), DML_CREATE_DEVICE_FLAG_NONE,
IID_PPV_ARGS(&revivalDml)); // succeeds
// 3. Build operator initializer for the same 2225 ops
ComPtr<IDMLOperatorInitializer> init;
revivalDml->CreateOperatorInitializer(2225, compiledOps, IID_PPV_ARGS(&init));
DML_BINDING_PROPERTIES bp = init->GetBindingProperties();
// bp.TemporaryResourceSize = 50,323,456
// bp.PersistentResourceSize = 692,224 (8 * 86,528)
// bp.RequiredDescriptorCount = 84
// 4. Allocate fresh resources on revival device
// (NOT reused from prior device — all freshly created)
ComPtr<ID3D12DescriptorHeap> heap = CreateDescriptorHeap(84);
ComPtr<IDMLBindingTable> bt = CreateBindingTable(init.Get(), heap.Get(), 84);
ComPtr<ID3D12Resource> tempBuf = CreateUAVBuffer(50'323'456);
// 5. Bind temporary resource — DEADLOCKS HERE, never returns
DML_BUFFER_BINDING bb = { tempBuf.Get(), 0, 50'323'456 };
DML_BINDING_DESC desc = { DML_BINDING_TYPE_BUFFER, &bb };
bt->BindTemporaryResource(&desc); // CPU hang
- Dominant language
- C++
- Stars
- 2.6k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/DirectML
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 62/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in microsoft/DirectML
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ros2/message_filters#338 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
subsurface/subsurface#4984 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·