Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

BindTemporaryResource hangs on new IDMLDevice after prior device removal during operator initializer dispatch

Aperta
#735 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
cpp

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. A prior IDMLDevice in the same process experienced device removal (GetDeviceRemovedReason returns DXGI_ERROR_DEVICE_HUNG / 0x887A0005) during an IDMLOperatorInitializer dispatch
  2. A new IDMLDevice is created via DMLCreateDevice after the prior device's removal (the underlying ID3D12Device is still alive — only the DML device died)
  3. A binding table is created on the new device for an IDMLOperatorInitializer whose GetBindingProperties().TemporaryResourceSize > 0, and BindTemporaryResource is called with a non-null DML_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

Lingua principale
C++
Stelle
2.6k
Fork
338
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/DirectML

Tutte le issue di microsoft/DirectML

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.