DXCoreAdapterState enumeration (dxcore_interface.h)

Important

Some information relates to a prerelease product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Defines constants that specify kinds of DXCore adapter states. Pass one of these constants to the IDXCoreAdapter::QueryState method to retrieve the adapter state item for a state kind; pass a constant to the IDXCoreAdapter::SetState method to set an adapter's info for a state item.

Syntax

typedef enum DXCoreAdapterState {
  IsDriverUpdateInProgress = 0,
  AdapterMemoryBudget = 1,
  AdapterMemoryUsageBytes = 2,
  AdapterMemoryUsageByProcessBytes = 3,
  AdapterEngineRunningTimeMicroseconds = 4,
  AdapterEngineRunningTimeByProcessMicroseconds = 5,
  AdapterTemperatureCelsius = 6,
  AdapterInUseProcessCount = 7,
  AdapterInUseProcessSet = 8,
  AdapterEngineFrequencyHertz = 9,
  AdapterMemoryFrequencyHertz = 10
} ;

Constants

 
IsDriverUpdateInProgress
Value: 0
Specifies the IsDriverUpdateInProgress adapter state, which when true indicates that a driver update has been initiated on the adapter but it has not yet completed. If the driver update has already completed, then the adapter will have been invalidated, and your QueryState call will return a HRESULT of DXGI_ERROR_DEVICE_REMOVED.

When calling QueryState, the IsDriverUpdateInProgress state item has type uint8_t, representing a Boolean value.

Important. This state item is not supported for SetState.
AdapterMemoryBudget
Value: 1
Specifies the AdapterMemoryBudget adapter state, which retrieves or requests the adapter memory budget on the adapter.

When calling QueryState, the AdapterMemoryBudget adapter state has type DXCoreAdapterMemoryBudgetNodeSegmentGroup for inputStateDetails, and type DXCoreAdapterMemoryBudget for outputBuffer.

Important. This state item is not supported for SetState.
AdapterMemoryUsageBytes
Value: 2
This query takes Physical Adapter Index and Dedicated vs. Shared as input; and outputs the Committed and Resident Memory Dedicated or Shared portions of GPU Memory, respectively.
AdapterMemoryUsageByProcessBytes
Value: 3
This query takes Engine ID, Physical Adapter Index, and Process Handle as input; and outputs Committed Memory and Resident Memory on Dedicated or Shared portions of GPU Memory, respectively.
AdapterEngineRunningTimeMicroseconds
Value: 4
This query takes Engine ID and Physical Adapter Index as input; and outputs Engine Running Time as output.
AdapterEngineRunningTimeByProcessMicroseconds
Value: 5
This query takes Engine ID, Physical Adapter Index, and Process Handle as input; and outputs Engine Running Time as output.
AdapterTemperatureCelsius
Value: 6
This query takes Physical Adapter Index as input, and outputs Current GPU Temperature in Degrees Celsius.
AdapterInUseProcessCount
Value: 7
This returns the number of processes using this adapter, and the PIDs in it, respectively.
AdapterInUseProcessSet
Value: 8
This returns the number of processes using this adapter, and the PIDs in it, respectively.
AdapterEngineFrequencyHertz
Value: 9
This query takes in the physical adapter and engine indices, and outputs the clock frequency of the respective engine in hertz. The output structure also includes the maximum frequency for the engine, with and without overclocking.


uint64_t GetEngineFrequency(com_ptr adapter, uint32_t physicalIndex, uint32_t engineIndex)
{
DXCoreAdapterEngineIndex index;
index.PhysicalAdapterIndex = physicalIndex;
index.EngineIndex = engineIndex;

DXCoreFrequencyQueryOutput frequencyData = {};

winrt::check_hresult(adapter->QueryState(DXCoreAdapterState::AdapterEngineFrequencyHertz, &index, &frequencyData));

return frequencyData.Frequency;
}
AdapterMemoryFrequencyHertz
Value: 10
This query takes in the physical adapter index, and outputs the clock frequency of its memory in hertz. The output structure also includes the maximum frequency for the memory, with and without overclocking.


uint64_t GetEngineFrequency(com_ptr adapter, uint32_t physicalIndex, uint32_t engineIndex)
{
uint64_t GetMemoryFrequency(com_ptr adapter, uint32_t physicalIndex)
{
DXCoreFrequencyQueryOutput frequencyData = {};

winrt::check_hresult(adapter->QueryState(DXCoreAdapterState::AdapterMemoryFrequencyHertz, &physicalIndex, &frequencyData));

return frequencyData.frequency;
}

Requirements

Requirement Value
Minimum supported client Windows 10 (Build 18936)
Header dxcore_interface.h (include dxcore.h)

See also

IDXCoreAdapter::QueryState, IDXCoreAdapter::SetState, DXCore reference, Using DXCore to enumerate adapters