vulkan icon indicating copy to clipboard operation
vulkan copied to clipboard

pyvulkan gives VkErrorExtensionNotPresent error, but extension is present.

Open hrbigelow opened this issue 3 months ago • 0 comments

Hi,

I've noticed that there are several situations where I get a VkErrorExtensionNotPresent from pyvulkan, yet I believe the extension is actually present in my Vulkan SDK. I had a look at the api.xml and I think there might be a bug in the parser. In any case, here is any example of the bug. Wondering if you could comment if this is indeed a bug in this repo or I'm misreading it. Thank very much!

import vulkan as vk

ext = [vk.VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
       vk.VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME]

info = vk.VkInstanceCreateInfo(
    pNext=None,
    flags=0,
    pApplicationInfo=None,
    enabledLayerCount=0,
    ppEnabledLayerNames=[],
    enabledExtensionCount=len(ext),
    ppEnabledExtensionNames=ext)

instance = vk.vkCreateInstance(info, None)

I get:

Traceback (most recent call last):
  File "/home/henry/ai/glass-imaging/image-generator/image_gen/tests/instance_extension.py", line 14, in <module>
    instance = vk.vkCreateInstance(info, None)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/henry/miniconda3/envs/vulkan/lib/python3.12/site-packages/vulkan/_vulkan.py", line 11045, in vkCreateInstance
    raise exception_codes[result]
vulkan._vulkan.VkErrorExtensionNotPresent

Yet, I see:

$ vulkaninfo
==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.280

...
Device Extensions: count = 133
       VK_KHR_timeline_semaphore                   : extension revision 2
...
VkPhysicalDeviceVulkan12Features:
---------------------------------
         timelineSemaphore                                  = true

hrbigelow avatar May 12 '24 05:05 hrbigelow