KhronosGroup/Vulkan-LoaderAndValidationLayers

vkEnumeratePhysicalDevices reports duplicates

t-chaik opened this issue · 3 comments

On my system, vkEnumeratePhysicalDevices reports two (identical) physical devices while, obviously, my machine, a laptop with an Intel HD Graphic 502 integrated graphics processor, running Fedora 27 and Mesa 17.3.6, only has one. Attached is the complete vulkaninfo output running with VK_LOADER_DEBUG=all.

The problem seems to be that the same ICD manifest file gets loaded twice, from both:

  • /usr/share/vulkan/icd.d
  • /usr/share//vulkan/icd.d

Digging into code, it seems that loader_get_manifest_files() does not process any double directory separator de-duplication. While the problem can probably be worked around by making sure that configure-time manifest paths do not end by a directory separator, having the loader to handle this kind of duplications would certainly avoid future pain.

vulkaninfo.linux.debug.txt

If this is confirmed and if this kind of de-duplication is welcome, I can work on a fix.

This may be identical to #2331, but I need to look into it a little to be sure.

I believe that what's going on is that you probably have a trailing slash in either XDG_DATA_DIRS or XDG_CONFIG_DIRS, and that the loader mistakes the files as being different as a result. The easiest solution would probably be to make the loader strip out redundant info from the search paths. That's assuming that this is the same issue. If you want to be sure that it is the same, check the environment variables I listed above and see if there's any trailing slashes. If there are, then this is definitely that same bug.

If this is confirmed and if this kind of de-duplication is welcome, I can work on a fix.

If you're willing to work on the fix that would be awesome. If you don't, I can look into this more, but it will probably be a few days before I'm able to get into it. Let me know if you are working on a fix, though, so I don't start working on it at the same time.

Definitely the same problem. I'll try to find some time to propose a fix next week. I guess you can close that bug as duplicate of #2331. Thank you!