Reputation: 4076
I built a mesa driver for Vulkan, and I have MoltenVK I am able to switch between both implementation (MoltenVK and Mesa)
However, I am not able to have the possibility of the two drivers. The enumeratePhysicalDevice only returns one driver.
Here is how I configure that thing:
export VK_ADD_DRIVER_FILES=/Users/amorrier/mesa/25.0/share/vulkan/icd.d/lvp_icd.aarch64.json:/Users/amorrier/VulkanSDK/1.4.304.1/macOS/share/vulkan/icd.d/MoltenVK_icd.json:/usr/local/share/vulkan/icd.d/MoltenVK_icd.json
It seems that only one is taken into account. If I launch a vulkaninfo with that configuration, it found only one PhysicalDevice (the one from mesa)
GPU0: VkPhysicalDeviceProperties: --------------------------- apiVersion = 1.4.305 (4210993) driverVersion = 0.0.1 (1) vendorID = 0x10005 deviceID = 0x0000 deviceType = PHYSICAL_DEVICE_TYPE_CPU deviceName = llvmpipe (LLVM 19.1.7, 128 bits) pipelineCacheUUID = 32352e30-2e30-6161-6161-616161616161
If I invert variable in the export :
export VK_ADD_DRIVER_FILES=/Users/amorrier/VulkanSDK/1.4.304.1/macOS/share/vulkan/icd.d/MoltenVK_icd.json:/usr/local/share/vulkan/icd.d/MoltenVK_icd.json:/Users/amorrier/mesa/25.0/share/vulkan/icd.d/lvp_icd.aarch64.json
It found the Apple M3 pro :
GPU0: VkPhysicalDeviceProperties: --------------------------- apiVersion = 1.2.296 (4202792) driverVersion = 0.2.2019 (10211) vendorID = 0x106b deviceID = 0xf030209 deviceType = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU deviceName = Apple M3 Pro pipelineCacheUUID = 81541f64-0f03-0209-0000-000100000000
I also tested on an instance in my own code, it is the same, only one device returned, not both...
Upvotes: -1
Views: 21
Reputation: 4076
Using the variable VK_DRIVER_FILES
instead solved the issue.
Upvotes: 0