MightyCreak/mesamatrix

OpenCL version identification is incorrect

Opened this issue · 4 comments

Currently the way the version seems to be tested is if every feature supported for the OpenCL version is listed, however, OpenCL has many optional features that are not required to report that version. It also gets a little weird with OpenCL 3 because OpenCL 2 is actually entirely optional for OpenCL 3.

Here is how I propose to fix the issue:

  • Remove any strings with "optional" from the version checking.

    1. check OpenCL support up to version 2
    2. skip to version 3 and check req features, if supported report version 3
    3. if not version 3 start checking 2.x as usual

It may be easier to just hardcode, but I'll look into fixing it eventually.

Khronos needs to get their shit together regarding API versionning. It's such a mess 😕

Khronos needs to get their shit together regarding API versionning. It's such a mess confused

They did, with version 3. That doesn't fix historical mistakes. Mesamatrix should take this into account.

FYI, Nvidia didn't support OpenCL 2.x because their hardware didn't support OpenCL 2.x features which were mandatory. When 3.0 made a lot of 2.x features optional, that's when Nvidia started supporting it.

Just to be sure, is it the same for Clover and Rusticl?


@norablackcat not sure I understand your logic here:

  1. check OpenCL support up to version 2
  2. skip to version 3 and check req features, if supported report version
  3. if not version 3 start checking 2.x as usual

Shoudn't it be:

  1. if version 3 is supported, report version 3;
  2. otherwise, check from version 1.0 to 2.x and report the latest version supported

Or is there another subtlety?

Also, OpenCL 3 seems to also have an optional extension, which is not handled by Mesamatrix yet (i.e. an extension is done or not, but can't be optional right now). So right now, from the Mesamatrix perspective, Clover OpenCL 3.0 will never be supported as long as "Optional device capabilities queries" is not done. That being said, other mandatory extensions in Clover OpenCL 3.0 are not implemented yet, so for now the fact that the optional extension is not done is not really an issue.

As for Rusticl, we're in luck because the extension "Optional device capabilities queries" is done for all the drivers, so right now that would make iris the only driver compatible with OpenCL 3.0 (Rusticl). Did I understand well?