realitix / vulkan

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

Issue with function _new in vulkan's __init__.py #39

Closed sunbearc22 closed 7 years ago

sunbearc22 commented 7 years ago

Hi realitix...

There seem to be an issue in vulkan's __init__.py", line 2204, in function _new

    ret = ffi.new(_type.cname + '*', init)[0]
OverflowError: can't convert negative number to unsigned

My original code which used to work:

    def _createLogicalDevice(self):
        '''Create Logical Device'''

        #1. Create Logical Device Queue Create Info.
        queue_priorities = [1.0]
        queue_family_indices = {self.queue_families_graphics_index,
                                self.queue_families_present_index}
        # Note: queue_family_indices is a set; when it's items value are equal,
        #       set keeps only one of them. 
        logical_device_queues_createInfo = [ VkDeviceQueueCreateInfo(
            queueFamilyIndex = i,
            queueCount = 1,
            pQueuePriorities = queue_priorities)
                        for i in queue_family_indices ]
        logging.info('Created logical_device_queues_createInfo.')

the error is in listcomp for i in queue_family_indices ]

Can you let me know what is wrong and how I can fix it?

sunbearc22 commented 7 years ago

I just noticed that my codes had all chosen to use my onboard Intel Skylake GPU as the physical device instead of using my Nvidia GPU. I got the same outcome from using your example_sdl2.py code and validation layer complained it can't create a surface.

I recalled that my display driver was just upgrade to Nvidia 384.90 today from an earlier Nvidia driver. I suspect this may be an issue caused by the new display driver. Will check on this and update you.

realitix commented 7 years ago

Hello @sunbearc22, I wait for your update but indeed it seems related to your driver.

sunbearc22 commented 7 years ago

Yes, the issue is caused by Ubuntu's nvidia-384 driver. Fortunately, users can quickly rectify the matter, while Ubuntu's graphics driver maintainer fix the mistake. More details given here.