Skip to content

Commit

Permalink
Use compute queues by default in DML EP (microsoft#20438)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
maggie1059 authored Apr 24, 2024
1 parent f78215a commit dfd4bce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion onnxruntime/core/providers/dml/dml_provider_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,11 @@ static D3D12_COMMAND_LIST_TYPE CalculateCommandListType(ID3D12Device* d3d12_devi
sizeof(feature_levels)
));

auto use_compute_command_list = (feature_levels.MaxSupportedFeatureLevel <= D3D_FEATURE_LEVEL_1_0_CORE);
// Use compute queue whenever possible on supported hardware to avoid TDR and maintain UI QoS
// Core and generic devices only have compute queues, DX11 has "immediate" submission, DX12 has both
auto use_compute_command_list = (feature_levels.MaxSupportedFeatureLevel <= D3D_FEATURE_LEVEL_1_0_CORE) ||
(feature_levels.MaxSupportedFeatureLevel >= D3D_FEATURE_LEVEL_12_0);

if (use_compute_command_list)
{
return D3D12_COMMAND_LIST_TYPE_COMPUTE;
Expand Down

0 comments on commit dfd4bce

Please sign in to comment.