vkEnumeratePhysicalDevices incorrect results


For the context:

  • Vulkan
  • Running on 2 graphics card on a laptop
  1. NVIDIA GeForce GTX 1650 Ti (Dedicated)
  2. AMD Radeon™ Graphics (Embedded)

I’m encountering an issue with vkEnumeratePhysicalDevices, it often returns pPhysicalDeviceCount = 0.
The result seems inconsistent and it seems to fix itself when I’m disabling the AMD card and reenabling it.
Has anyone encountered this issue and manage to solve it?
Otherwise, does someone know how this function works under the hood or how I can find out?


You can find out these things in LoaderAndLayerInterface.md.

Basically the Loader finds *.jsons based on registry or by agreed upon path. The json points to the ICD dll. The Loader distributes your vkEnumeratePhysicalDevices call to all the ICDs, and collects all the results together to return to you. The ICD can return whatever it wants, particularly if it is switchable graphics nonsense it can do some weird magic.

Additionally you could try the VK_LOADER_DEBUG=all variable if something relevant is actually reported in the spammy log.

One thing that sometimes helps is update the drivers for the integrated GPU with the driver package from the notebook manufacturer.

1 Like

Can you set the environment variable DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1?
set DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 should work in command prompt, $env:DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1="1" in powershell, and export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 in terminal (linux).

The AMD switchable graphics layer is a known issue, and this env-var should disable it.

1 Like

Thanks guys!

Just for the record, with VK_LOADER_DEBUG=all, I’ve noticed by disabling and reenabling the AMD graphics card that it changes boot order of loaderAddJsonEntry and Found ICD manifest file
Also it just fails this error at the end:
ERROR: setupLoaderTrampPhysDevs: Failed during dispatch call of ‘vkEnumeratePhysicalDevices’ to lower layers or loader to get count.

Otherwise no other clue

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.