1
votes

I'm learning Vulkan by API spec (http://vulkan-spec-chunked.ahcox.com/ch02s09.html), and I'm little confused about how physical devices are in Vulkan. I do have only one intel physical video card device, but vkEnumeratePhysicalDevices returns count of 2. The devices are identical, but the queue flags seems differ, and the queue flags are undocumented (actually they are, but only to flag 8, in second queue I do have the flag values 16 and 32).

typedef enum VkQueueFlagBits {
    VK_QUEUE_GRAPHICS_BIT = 0x00000001,
    VK_QUEUE_COMPUTE_BIT = 0x00000002,
    VK_QUEUE_TRANSFER_BIT = 0x00000004,
    VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008,
} VkQueueFlagBits;

here is the output of my vulkan code:

GPU count: 2 ( physical devices )
Physical Device 0:
        Device API version: 1.0.42 - 4194346
        Device Vendor Id: 0x8086
        Device Id: 1916
        Device Driver version: 0.0.1 - 1
        Device type: 1
        Device Name: Intel(R) HD Graphics 520 (Skylake GT2)
        Device Pipeline UID: f557cfd4
        Queue Properties:
                Flags: 7
                Count: 1
                ts Valid Bits: 24
Physical Device 1:
        Device API version: 1.0.42 - 4194346
        Device Vendor Id: 0x8086
        Device Id: 1916
        Device Driver version: 0.0.1 - 1
        Device type: 1
        Device Name: Intel(R) HD Graphics 520 (Skylake GT2)
        Device Pipeline UID: f557cfd4
        Queue Properties:
                Flags: 49
                Count: 0
                ts Valid Bits: 1

Someone can help me understand why there is 2 physical devices for the same real device and the missing flags ?

1
and a count of 0? seems like a bug TBH. - ratchet freak
Seems like a failed driver instalation. I would try to uninstall it, and if some device is left after that then it may need manual cleanup. - krOoze
ratchet freak, the count here is the queueCount is the unsigned integer count of queues in this queue family. Don't seems to be a bug for me. - ton
krOoze, I've build and installed it manually from source. The SDK samples are running well... mesa and Xorg are fine. Nothing except this are strange. - ton
A count of 0 means you won't be able to get a queue from that family, so it's of no point to have it enumerated. - ratchet freak

1 Answers

2
votes

The count=0 of the second device is curious. More seriously, its flags and tsVB values are corrupted (49 is not an valid value for flags and 1 not valid for tsVB).

This pretty much boils down to there being one extraneous *.json file on your system.

These *.json files store informations about ICDs present on the machine. They are stored in standard location(s).

vkEnumeratePhysicalDevices+vkGetPhysicalDeviceProperties are relatively dumb commands doing nothing much else than reading said *.json file(s) and returning its contents. I think though that calling something "real" like vkCreateDevice would not work on the badly installed driver.

What exactly happened to creare this problem is up to your curiosity to explore. For starters I believe on Linux distros there is a command to map a file to its originating package. It will probably be something about bad cleanup of previous driver, or possibly bug in the installation script of the new one. At least one person had this problem before.

Based on what I explained here, I believe this is relatively benign bug. The first device should work just fine. And you can just ignore the second one. Or simply delete its *.json manifest to prevent it from showing up in vkEnumeratePD.