Search code examples
linuxdrivernvidiavulkan

How does vkEnumeratePhysicalDevices retrieve information about the system configuration?


I recently installed a new Nvidia proprietary driver on linux, everything works as expected, except now Vulkan reports that there are two graphics cards with the same driver version, same name, same queue families and so on, though I only have a single graphics card installed. I'm now really curious why this is the case. I tried looking at the implementation of the Vulkan loader at https://github.com/KhronosGroup/Vulkan-Loader, but I couldn't make much sense of it.


Solution

  • The ICD discovery on Linux works per this document: https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#icd-discovery-on-linux

    Basically there can be json files in predetermined paths. One such json file contains the path to a driver file.

    Furthermore a driver can report more physical devices. The Loader simply calls vkEnumeratePhysicalDevices of each driver and pools together the results.

    Your problem is probably a duplicate json file. You probably have the proprietary and free driver installed next to each other.