Model M releases its resources after a drain timeout, though game lists may use them
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
Start in clean/runtime/interop/executor_d3d12.cpp: drain() around line 329 and the destructor around line 52, which releases proxy16_, proxy32_, mpoint_ and retired_. Then check device_d3d12.cpp at lines 146-185 for the retain-on-failure path. The test seam is in dx12/tests/native_direct_test.cpp using the WARP Gpu helper near line 46. Done means drain() returns bool, the destructor retains the runtime on timeout when the device is not removed, and the WARP test confirms a probe object is not released.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
D3d12Executor::drain() (clean/runtime/interop/executor_d3d12.cpp:329) polls external_done() < external_recorded() for up to 5000 × Sleep(1). It returns void. On timeout it only logs.
The destructor (:52) then calls begin_teardown() and runtime_destroy(rt_) unconditionally, and releases proxy16_, proxy32_, mpoint_ and retired_ (:59-:61). The game's recorded list references these objects (df.output, df.motion, the copy16 source).
runtime_destroy ends in the device destructor (clean/runtime/device_d3d12.cpp:146). Its "retain on failure" path (:148-:163) depends only on finish_queue() (:869), which submits to and waits on the device's own create-time queue. It does not look at external_done(). When that succeeds, :166-:185 releases the arena, PSOs, descriptor heap, root signatures, direct textures and the marker.
shutdown (clean/runtime/interop/backend.cpp:1933) calls exec_->drain() and then exec_.reset(). Nothing else waits.
When it can happen
Only if the game's list runs more than 5 s after the destroy call. Two cases:
- The game records a dispatch and destroys the context before it submits that list, on the same thread (for example a settings or resize handler in the middle of a frame). The wait can never succeed, so the game thread freezes for 5 s, and the game then submits a list whose resources have been freed.
- The queue is stalled for more than 5 s without device removal. This is rare, because a driver timeout normally fires first.
In the common case the front end parks destroyed contexts (clean/fsr/src/frontend.h:156), so the executor is not torn down when the game calls destroy. Most engines also flush the GPU before releasing an upscaler. The backend's own contract says destroy "waits for in-flight work" (clean/fsr/include/wronggpu_upscaler.h:210); it does not say unsubmitted work is safe.
The impact is device removal. The probability is low.
Found by reading the code. It has not been reproduced.
To do
This is the minimal fix, matching the device's existing policy at device_d3d12.cpp:157-:163:
- Make
drain()returnbool. - In
~D3d12Executor, if the drain timed out andGetDeviceRemovedReason()isS_OK: log it and retain the whole runtime. Skipbegin_teardown,runtime_destroyand the proxy,mpoint_andretired_releases, and deliberately leakrt_. - If the device is removed, release as now.
The cost is a leak of the arena (the size of the network) plus the proxies, per occurrence, until the process exits. A new context on the same device then has less VRAM; the OOM wait at device_d3d12.cpp:1170 copes by waiting and failing cleanly. A later improvement would be a process-wide list that keeps the executor and releases it once external_done() catches up.
Test
CPU / WARP, with a seam so external_done() can be faked. dx12/tests/native_direct_test.cpp has a WARP Gpu helper (:46). Call begin_external and end_external on a list that is never executed, destroy the device, and assert that a tracked probe object was not released. A GPU test is needed for the full executor path.
Related: #63, #58 (objects released while a recorded list may still use them), #68.
- Lenguaje dominante
- C++
- Estrellas
- 12
- Forks
- 2
- Merge medio
- 3 h 10 min
- PR fusionados (30 d)
- 171
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de phantoslayer21/wronggpu
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
phantoslayer21/wronggpu#275 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
phantoslayer21/wronggpu#274 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
phantoslayer21/wronggpu#241 ·
Los mantenedores suelen responder en 1 día
-
bug build
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
phantoslayer21/wronggpu#234 ·
Los mantenedores suelen responder en 1 día
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildAbiertobug build
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
phantoslayer21/wronggpu#233 ·
Los mantenedores suelen responder en 1 día
Todos los issues de phantoslayer21/wronggpu
Issues similares
-
ai_p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
ClickHouse/ClickHouse#132519 ·
Los mantenedores suelen responder en 1 día
-
patch_advisor_json_integration fails when the build tree is reached through a symbolic linkPosiblemente ocupada @DerKarussellbremser la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
boykopovar/AnyPS5#22581 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
juce-framework/JUCE#1810 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
petercorke/robotics-toolbox-python#952 ·
Los mantenedores suelen responder en 1 día