[GSD-13927] Deadlock in zeCommandListAppendLaunchKernelWithArguments with concurrent launches: SVMAllocsManager::containerLockedById shared across threads (setKernelState)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- cpp
调研方向
Read CommandList::setKernelState(), SVMAllocsManager::obtainReadContainerLock(), and getSVMAlloc() in the compute-runtime code, then trace the nested KernelImp::setArgBuffer() call described in the report. Reproduce with the linked l0_mt_submit.cpp steps and compare against the workaround setting. Done means concurrent launches complete without deadlock while the USM reuse cleaner is active.
由索引模型根据 Issue 内容生成。
描述
Pre-submission Checklist
- I am using the latest GPU driver version (download center)
- I have searched for similar issues and found none
GPU Hardware
Intel Arc Pro B70 (4 cards; one card is enough to reproduce)
GPU Detailed Information
Name : Intel(R) Arc(TM) Pro B70 Graphics
DriverVersion : 32.0.101.8976
DriverDate : 20260828000000.000000-000
VideoProcessor : Intel(R) Arc(TM) Pro B70 Graphics Family
AdapterRAM : 4293918720
PNPDeviceID : PCI\VEN_8086&DEV_E223&SUBSYS_0105172F&REV_00\6&2C26ECC2&0&00080009
Name : Intel(R) Arc(TM) Pro B70 Graphics
DriverVersion : 32.0.101.8976
DriverDate : 20260828000000.000000-000
VideoProcessor : Intel(R) Arc(TM) Pro B70 Graphics Family
AdapterRAM : 4293918720
PNPDeviceID : PCI\VEN_8086&DEV_E223&SUBSYS_60251849&REV_00\6&A0CECBF&0&00080019
Name : Intel(R) Arc(TM) Pro B70 Graphics
DriverVersion : 32.0.101.8976
DriverDate : 20260828000000.000000-000
VideoProcessor : Intel(R) Arc(TM) Pro B70 Graphics Family
AdapterRAM : 4293918720
PNPDeviceID : PCI\VEN_8086&DEV_E223&SUBSYS_60251849&REV_00\6&2CA3521A&0&00080009
Name : Intel(R) Arc(TM) Pro B70 Graphics
DriverVersion : 32.0.101.8976
DriverDate : 20260828000000.000000-000
VideoProcessor : Intel(R) Arc(TM) Pro B70 Graphics Family
AdapterRAM : 4293918720
PNPDeviceID : PCI\VEN_8086&DEV_E223&SUBSYS_17018086&REV_00\6&1D38AD12&0&00080009
Driver Installation Details
Driver 32.0.101.8976 (2026-08-27), installed from Intel's Arc Pro driver package. Level Zero version reported by SYCL: 1.15.39183. Also reproduced on 32.0.101.8805 (L0 1.15.37858).
Windows Build Information
WindowsProductName : Windows 10 Pro
WindowsVersion : 2009
OsHardwareAbstractionLayer : 10.0.26100.1
Actual Behavior
With several host threads launching kernels at the same time (through SYCL / Unified Runtime L0 v2 adapter, which uses zeCommandListAppendLaunchKernelWithArguments), the process deadlocks inside ze_intel_gpu64.dll within seconds. All blocked threads wait in RtlAcquireSRWLockShared / RtlAcquireSRWLockExclusive under zeCommandListAppendLaunchKernelWithArguments, plus one driver-internal thread (the USM reuse cleaner) waiting exclusive. It only happens when something frees USM (oneMKL gemm scratch in our reproducer), which keeps the cleaner thread taking SVMAllocsManager::mtx exclusive.
Expected Behavior
Concurrent kernel launches from multiple threads complete without deadlock.
Reproduction Rate
Always reproduces - 100%
Steps to Reproduce
- Build the reproducer (single file, linked below):
icx -fsycl /O2 /EHsc /std:c++17 /DUSE_MKL /DMKL_ILP64 /Qmkl l0_mt_submit.cpp /Fe:l0_mt_submit_mkl.exe /link mkl_sycl_blas_dll.lib - set ONEAPI_DEVICE_SELECTOR=level_zero:0
- l0_mt_submit_mkl.exe 4 60 3 32
(4 threads, 60 s, mode 3 = kernels + USM memcpy + oneMKL gemm, flag 32 = warm-up) - Within ~5 s, per-thread progress stops; the program reports no progress for 30 s and exits with code 2 (or stays hung).
- With UR_L0_V2_DISABLE_ZE_LAUNCH_KERNEL_WITH_ARGS=1 set, the same command completes: 10 of 10 runs, ~1M iterations per thread.
Is this a regression?
- Yes, this is a regression - functionality that previously worked is now broken
Last Known Working Driver Version
Unknown: Introduced by commit 6d6715bebf ("performance: Lock svm allocs mutex once in appendLaunchKernelWithArgs", NEO-15774, first in 25.44.36015). Not bisected across driver releases; we have no older driver result.
First Known Failing Driver Version
32.0.101.8805
API Call Logs
No response
Windows Event Viewer Logs
N/A - hang, not a crash
Crash Dumps / Minidumps
N/A - stacks-repro-utf8.txt
Source Code / Reproducer
https://github.com/Captain-Tripps/b70-lab/tree/main/reproducers/l0-deadlock (l0_mt_submit.cpp, single file ~200 lines; stacks and run logs in the same folder)
Command Line / Application Details
steps 1–3 from above
oneAPI Version (if applicable)
oneAPI version: Intel oneAPI DPC++/C++ Compiler 2026.0.0 (Build 20260331), oneMKL 2026.0; runtime DLLs ur_adapter_level_zero_v2.dll, sycl9.dll, mkl_sycl_blas.6.dll
System configuration: AMD EPYC 7402P, 4x Arc Pro B70 32 GB (you can skip the RAM and board details)
Screenshots / SSU report: skip both.
Additional notes:
Root cause found in compute-runtime (NEO). CommandList::setKernelState() (the zeCommandListAppendLaunchKernelWithArguments path) holds SVMAllocsManager::mtx (std::shared_mutex, which is an SRW lock on Windows) shared via obtainReadContainerLock(). That helper records the owner in SVMAllocsManager::containerLockedById, a single non-atomic std::thread::id for the whole driver. getSVMAlloc() skips locking only if containerLockedById == this_thread. With two threads in setKernelState() at once, the second overwrites (or, on exit, clears) the first one's id. The first thread's nested KernelImp::setArgBuffer() -> getSVMAlloc() then calls lock_shared() on a lock it already holds shared. If another thread is queued for mtx exclusive at that moment, the SRW lock blocks the recursive shared request and the process deadlocks. In our hang that thread was the USM reuse-cleaner thread in trimOldAllocs -> freeSVMAllocImpl -> freeSVMData, which also holds mtxForIndirectAccess. This was introduced by commit 6d6715bebf ("Lock svm allocs mutex once in appendLaunchKernelWithArgs", NEO-15774) and is still on master.
Suggested fix: make the owner marker per-thread (for example a thread_local record of which manager this thread has locked) instead of a shared member.
Confirmed workaround: UR_L0_V2_DISABLE_ZE_LAUNCH_KERNEL_WITH_ARGS=1. With our reproducer, the baseline hung in 6 of 6 runs and the workaround ran 10 of 10 without a hang (Arc Pro B70, driver 32.0.101.8976, Windows 11). The same NEO code is used on Linux, so Linux is likely affected too (not tested).
Also reported to intel/llvm#23530 (UR side, now known to be a driver issue) and community.intel.com/t/144119.
System Configuration
CsProcessors : {AMD EPYC 7402P 24-Core Processor }
CsTotalPhysicalMemory : 102941720576
CsManufacturer : To Be Filled By O.E.M.
CsModel : ROMED8-2T
Screenshots / Video
No response
Intel System Support Utility Report
No response
Additional Notes
No response
- 主要语言
- C++
- 星标
- 1.5k
- 派生
- 304
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
intel/compute-runtime 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
intel/compute-runtime#1040 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
intel/compute-runtime#943 ·
-
难度 4/5 3-5 天 新手友好度 25/100
intel/compute-runtime#1043 ·
-
难度 3/5 半天 新手友好度 55/100
intel/compute-runtime#1042 ·
-
难度 3/5 半天 新手友好度 55/100
intel/compute-runtime#1041 ·
查看 intel/compute-runtime 的全部 Issue
相似的 Issue
-
Issue-Bug Needs-Triage
难度 2/5 1-3 小时 新手友好度 62/100
microsoft/winget-cli#6645 ·
维护者通常 2 天内回复
-
cleanup help wanted
难度 2/5 1-3 小时 新手友好度 62/100
ESPresense/ESPresense#2602 ·
维护者通常 1 天内回复
-
devex good first issue
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
artifact:simulation-scenario domain:physics good first issue help wanted role:validation testing
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 3 天内回复