> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RemoveDevice (XBOX Series consoles)

> You can call **RemoveDevice** to indicate to the Direct3D 12 runtime that the GPU device encountered a problem, and can no longer be used.

You can call **RemoveDevice** to indicate to the Direct3D 12 runtime that the GPU device encountered a problem, and can no longer be used. Doing so will cause all devices' monitored fences to be signaled. Your application typically doesn't need to explicitly call **RemoveDevice**.

## Remarks

Because device removal triggers all fences to be signaled to `UINT64_MAX`, you can create a callback for device removal using an event.

```cpp theme={null}
HANDLE deviceRemovedEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
assert(deviceRemovedEvent != NULL);
_deviceFence->SetEventOnCompletion(UINT64_MAX, deviceRemoved);

HANDLE waitHandle;
RegisterWaitForSingleObject(
&waitHandle,
deviceRemovedEvent,
OnDeviceRemoved,
_device.Get(), // Pass the device as our context
INFINITE, // No timeout
0 // No flags
);

void OnDeviceRemoved(PVOID context, BOOLEAN)
{
ID3D12Device* removedDevice = (ID3D12Device*)context;
HRESULT removedReason = removedDevice->GetDeviceRemovedReason();
// Perform app-specific device removed operation, such as logging or inspecting DRED output
}
```

## Requirements

**Header:** d3d12\_xs.h\
**Library:** d3d12\_xs.lib\
**Supported Platforms**: XBOX Series consoles

## See Also


## Related topics

- [GetDeviceRemovedReason](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getdeviceremovedreason_public.md)
- [ID3D12DeviceRemovedExtendedData](/reference/graphics/d3d12/interfaces/id3d12deviceremovedextendeddata/id3d12deviceremovedextendeddata_public.md)
- [D3D12_DEVICE_REMOVED_EXTENDED_DATA](/reference/graphics/d3d12/structs/d3d12_device_removed_extended_data_public.md)
- [ID3D12DeviceRemovedExtendedDataSettings](/reference/graphics/d3d12/interfaces/id3d12deviceremovedextendeddatasettings/id3d12deviceremovedextendeddatasettings_public.md)
- [D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA](/reference/graphics/d3d12/structs/d3d12_versioned_device_removed_extended_data_public.md)
