Class DXGIAdapterEnumerator
- Namespace
- VisioForge.Core.Windows
- Assembly
- VisioForge.Core.dll
Enumerates DXGI graphics adapters on Windows and maps LUIDs to CUDA device ordinals. Returns an empty list and null translations on non-Windows platforms.
public static class DXGIAdapterEnumeratorInheritance
Inherited Members
Methods
Enumerate()
Enumerates hardware and software graphics adapters visible to DXGI. Results are cached for the lifetime of the process; call VisioForge.Core.Windows.DXGIAdapterEnumerator.Invalidate to refresh after a device hotplug.
public static IReadOnlyList<EncoderAdapterInfo> Enumerate()Returns
Invalidate()
Drops the cached adapter list so the next VisioForge.Core.Windows.DXGIAdapterEnumerator.Enumerate call re-queries DXGI. Use sparingly; DXGI enumeration allocates native handles.
public static void Invalidate()LuidToCudaDeviceId(long)
Translates a DXGI adapter LUID to a CUDA device ordinal suitable for the
cuda-device-id property on nvh264enc / nvh265enc.
Returns null if the LUID does not map to an NVIDIA adapter or CUDA is not
available on this host.
public static uint? LuidToCudaDeviceId(long luid)Parameters
luidlong
Returns
- uint?
Remarks
Best-effort heuristic. This method does NOT query CUDA or NVML — it
simply walks the DXGI adapter list and returns the enumeration index of the
matching NVIDIA adapter. On single-NVIDIA-GPU systems this typically matches
the CUDA device ordinal, but on multi-NVIDIA-GPU rigs the DXGI enumeration
order is not guaranteed to match CUDA's ordinal order (CUDA can reorder
devices based on compute capability, CUDA_VISIBLE_DEVICES, driver
version, and other factors).
When precise GPU pinning is required, pass an explicit
CudaDeviceId on the settings class instead of relying on this
heuristic.