KomputeProject / kompute

General purpose GPU compute framework built on Vulkan to support 1000s of cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.
http://kompute.cc/
Apache License 2.0
1.94k stars 146 forks source link

Fix vulkan version parsing #325

Closed Crydsch closed 1 year ago

Crydsch commented 1 year ago

This PR fixes an issue with the cmake script cmake/check_vulkan_version.cmake where it would not parse the output of vulkaninfo correctly. This results in the wrong header version being detected and therefore failing the driver check.

This PR fixes Issue #317

There are two bugs that have been addressed:

  1. Even if the script detect a complete version in the vulkan header file (VK_HEADER_VERSION_COMPLETE) it fails to parse it, because the if statement is not evaluating the string value correctly.
    This has been fixed by checking with STREQUAL.
  2. When parsing the apiVersion itself the used regex used, expects some extra text and brackets, which are not present on all installations/drivers. Was there a change perhaps?
    I checked this on 3 Machines with Ubuntu20, Ubuntu22 and Fedora38. With Vulkan 1.1.182, Vulkan 1.3.238 and Vulkan 1.3.243 installed respectively.

    The version always looks like this: apiVersion = 4206830 (1.3.238)

    This has been fixed by relaxing the regex by adding * to these brackets and text matches.
    With these changes it parses the version correctly and should still parse these other formats as well.

marcogmaia commented 1 year ago

Thanks, this fixed the issue for me.

axsaucedo commented 1 year ago

Thank you for your contribution!