Skip to content

Commit dfd4bce

Browse files
authored
Use compute queues by default in DML EP (#20438)
### Description We originally only use compute queues for compute-only devices; this change sets the default for DX12 devices to use compute queues as well. ### Motivation and Context There have been issues with TDRs occurring when using the current default queues, which doesn't happen on compute queues.
1 parent f78215a commit dfd4bce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

onnxruntime/core/providers/dml/dml_provider_factory.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,11 @@ static D3D12_COMMAND_LIST_TYPE CalculateCommandListType(ID3D12Device* d3d12_devi
542542
sizeof(feature_levels)
543543
));
544544

545-
auto use_compute_command_list = (feature_levels.MaxSupportedFeatureLevel <= D3D_FEATURE_LEVEL_1_0_CORE);
545+
// Use compute queue whenever possible on supported hardware to avoid TDR and maintain UI QoS
546+
// Core and generic devices only have compute queues, DX11 has "immediate" submission, DX12 has both
547+
auto use_compute_command_list = (feature_levels.MaxSupportedFeatureLevel <= D3D_FEATURE_LEVEL_1_0_CORE) ||
548+
(feature_levels.MaxSupportedFeatureLevel >= D3D_FEATURE_LEVEL_12_0);
549+
546550
if (use_compute_command_list)
547551
{
548552
return D3D12_COMMAND_LIST_TYPE_COMPUTE;

0 commit comments

Comments
 (0)