realitix / vulkan

The ultimate Python binding for Vulkan API
Apache License 2.0
501 stars 46 forks source link

"Invalid SurfaceKHR object" when running example #15

Closed TheSilvus closed 7 years ago

TheSilvus commented 7 years ago

When trying to run the example, it crashes and I have to forcefully close it. I tried pulling and installing the library from the most recent master branch, but this didn't fix the issue.

availables extensions: ['VK_KHR_surface', 'VK_KHR_win32_surface', 'VK_EXT_debug_report', 'VK_NV_external_memory_capabilities', 'VK_KHR_get_physical_device_properties2', 'VK_KHX_device_group_creation', 'VK_EXT_display_surface_counter']

availables layers: ['VK_LAYER_LUNARG_api_dump', 'VK_LAYER_LUNARG_core_validation', 'VK_LAYER_LUNARG_monitor', 'VK_LAYER_LUNARG_object_tracker', 'VK_LAYER_LUNARG_parameter_validation', 'VK_LAYER_LUNARG_screenshot', 'VK_LAYER_LUNARG_standard_validation', 'VK_LAYER_GOOGLE_threading', 'VK_LAYER_GOOGLE_unique_objects', 'VK_LAYER_LUNARG_vktrace', 'VK_LAYER_NV_optimus', 'VK_LAYER_VALVE_steam_overlay', 'VK_LAYER_RENDERDOC_Capture']

Create windows surface
availables devices: ['GeForce GTX 960M']
selected device: GeForce GTX 960M

2 available queue family
DEBUG: ObjectTracker Invalid SurfaceKHR Object 0x3ffaba800000001. The spec valid usage text states 'surface must be a valid VkSurfaceKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter)
realitix commented 7 years ago

Hello @TheSilvus Can you give me your OS version and architecture (32, 64 bits?)

TheSilvus commented 7 years ago

Windows 10, 64bit Thanks for your fast reply!

realitix commented 7 years ago

Please @TheSilvus, can you add

143 surface = surface_mapping[wm_info.subsystem]()
144 print("my surface is : %s\n" % wm_info.subsystem)

and give me the content of wm_info.subsystem ?

TheSilvus commented 7 years ago

It simply prints

my surface is : 1
realitix commented 7 years ago

Ok it's good, 1 means Windows.

Can you print the content of surface now ?

TheSilvus commented 7 years ago
 <cdata 'struct VkSurfaceKHR_T *' 0x00000001>
realitix commented 7 years ago

Strange... It was working on my Windows 10 but with an intel IGPU. Maybe my last commit broke it. Can you checkout on the commit 8a7809966050ca96aa33e4df23ae5a33f76b0839 and try again ?

TheSilvus commented 7 years ago

Doing that didn't work for me. I reinstalled the module after doing that using python setup.py install, that should be enough - right?

I'll be on the go and be able to report back in 3-4 hours.

realitix commented 7 years ago

The checkout only update the exemple file so it should be enough. It's a strange bug you face, I have to test it on my Windows machine, but I can do it only from September.

TheSilvus commented 7 years ago

Is there anything else we can do to fix this? Anyway, thanks for trying to help!

realitix commented 7 years ago

Of course, you can try to understand the problem and fix it. By the way, can you try the examples in this pull request https://github.com/realitix/vulkan/pull/13 ? Theses examples are written for windows so it should work.

TheSilvus commented 7 years ago

The same error occurs. I tried running the example of another library (in another language) to ensure nothing is wrong with my install - it worked. I'll try to run the example when I'm back home, in about 2 weeks. I'll eventually be able to run it on a friend's PC, we'll see about that. Thank you for your active help!

realitix commented 7 years ago

Thanks @TheSilvus for the active report. We'll find the problem!

realitix commented 7 years ago

It may be an ABI mismatch. I hope not because it's hard to debug.

TheSilvus commented 7 years ago

I tried it on a friends machine (also Windows 10, although another graphics card) - it worked there, so it's probably related to my machine. I have access to another machine with the same specs, I could try it there - although it could take some time until I will be able to.

realitix commented 7 years ago

Sure, I let the issue open for now.

Berserker66 commented 7 years ago

So, interesting coincidence. A friend of mine, volunteered to test my project. He has a GTX960, though non mobile. He happened to get this issue and it turned out his driver was from march. Updating the driver fixed this issue for him.

So - probably a driver issue.

TheSilvus commented 7 years ago

It could be, I'm currently unable to access the laptop and it works on my other machine. I'll close the issue for now; if new problems pop up it can be reopened

realitix commented 7 years ago

Thanks for your work guys!

Artem3213212 commented 1 year ago

For someone who find it in google. The same problem can be if you use 32bit python interpreter. (At least at 3.8.10 release I had it)