-
Notifications
You must be signed in to change notification settings - Fork 12.2k
vulkan: fix storageBuffer16BitAccess detection on some adreno driver #8837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Can you upload and link the |
|
You can upload it as a file or snippet to Github and link it here. The text you posted doesn't contain the relevant parts. |
i double checked that it is the full output |
Alright, I am confused cause it shows neither |
|
||
vkGetPhysicalDeviceFeatures2(device->physical_device, &device_features2); | ||
|
||
device->fp16 = device->fp16 && vk12_features.shaderFloat16; | ||
|
||
if (!vk11_features.storageBuffer16BitAccess) { | ||
if (!(vk11_features.storageBuffer16BitAccess && storage_16bit.storageBuffer16BitAccess)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!(vk11_features.storageBuffer16BitAccess && storage_16bit.storageBuffer16BitAccess)) { | |
if (!vk11_features.storageBuffer16BitAccess || !storage_16bit.storageBuffer16BitAccess) { |
Just a nitpick, but I think it's more readable this way.
VkPhysicalDevice16BitStorageFeatures storage_16bit; | ||
storage_16bit.pNext = nullptr; | ||
storage_16bit.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; | ||
vk11_features.pNext = &storage_16bit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this is against the Vulkan Specification and causes a validation error when run with Validation layers enabled:
vkCreateDevice(): If the pNext chain includes a VkPhysicalDeviceVulkan11Features structure, then it must not include a VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES structure.
I'm not sure how to handle this properly, we could avoid VkPhysicalDeviceVulkan11Features
entirely, but I don't want to do that just cause of Qualcomm driver issues. Do you have an idea?
@rhjdvsgsgks Hi Sir,sorry to bother you.May I ask you which tag or commit do you use for testing in Adreno GPU devices?I filed a issue here #8965 ,and wanna check whether it's the code base too old for this issue.Can you use Vulkan-GPU for acceleration in Android device?if so can you give me some instructions?thanks a lot. |
on some adreno driver lacking
VK_KHR_16bit_storage
.storage_16bit.storageBuffer16BitAccess
would return false butvk11_features.storageBuffer16BitAccess
would still true. add a check for both of them.i also removed
vk11_features
inggml_vk_print_gpu_info
. since it is unused