# vkEnumeratePhysicalDevices(3) Manual Page

## Name

vkEnumeratePhysicalDevices - Enumerates the physical devices accessible to a Vulkan instance

Loading… please wait.

## C Specification

To retrieve a list of physical device objects representing the physical devices installed in the system, call:

    // Provided by VK_VERSION_1_0
    VkResult vkEnumeratePhysicalDevices(
        VkInstance                                  instance,
        uint32_t*                                   pPhysicalDeviceCount,
        VkPhysicalDevice*                           pPhysicalDevices);

## Parameters

- `instance` is a handle to a Vulkan instance previously created with vkCreateInstance.

- `pPhysicalDeviceCount` is a pointer to an integer related to the number of physical devices available or queried, as described below.

- `pPhysicalDevices` is either `NULL` or a pointer to an array of `VkPhysicalDevice` handles.

## Description

If `pPhysicalDevices` is `NULL`, then the number of physical devices available is returned in `pPhysicalDeviceCount`. Otherwise, `pPhysicalDeviceCount` must point to a variable set by the application to the number of elements in the `pPhysicalDevices` array, and on return the variable is overwritten with the number of handles actually written to `pPhysicalDevices`. If `pPhysicalDeviceCount` is less than the number of physical devices available, at most `pPhysicalDeviceCount` structures will be written, and `VK_INCOMPLETE` will be returned instead of `VK_SUCCESS`, to indicate that not all the available physical devices were returned.

Valid Usage (Implicit)

- VUID-vkEnumeratePhysicalDevices-instance-parameter
  `instance` must be a valid VkInstance handle

- VUID-vkEnumeratePhysicalDevices-pPhysicalDeviceCount-parameter
  `pPhysicalDeviceCount` must be a valid pointer to a `uint32_t` value

- VUID-vkEnumeratePhysicalDevices-pPhysicalDevices-parameter
  If the value referenced by `pPhysicalDeviceCount` is not `0`, and `pPhysicalDevices` is not `NULL`, `pPhysicalDevices` must be a valid pointer to an array of `pPhysicalDeviceCount` VkPhysicalDevice handles

Return Codes

On success, this command returns

  - `VK_SUCCESS`

  - `VK_INCOMPLETE`

On failure, this command returns

  - `VK_ERROR_OUT_OF_HOST_MEMORY`

  - `VK_ERROR_OUT_OF_DEVICE_MEMORY`

  - `VK_ERROR_INITIALIZATION_FAILED`

## See Also

VK_VERSION_1_0, VkInstance, VkPhysicalDevice

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright 2014-2024 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0