Skip to content

ocl-icd 2.3.1 (new formula) #104619

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

Closed
wants to merge 1 commit into from
Closed

ocl-icd 2.3.1 (new formula) #104619

wants to merge 1 commit into from

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Jun 28, 2022

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Split off from #103141

See other PR for why this we need to use this instead of opencl-icd-loader.

Also, this is the option most major Linux distros have picked (https://repology.org/project/ocl-icd/versions) like Debian/Ubuntu, Fedora, Arch, Gentoo, ...

@cho-m cho-m added the CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. label Jun 28, 2022
@cho-m cho-m mentioned this pull request Jun 28, 2022
6 tasks
@BrewTestBot BrewTestBot added new formula PR adds a new formula to Homebrew/homebrew-core ruby Ruby use is a significant feature of the PR or issue labels Jun 28, 2022
@danielnachun
Copy link
Contributor

I finally had a chance to test all 9 of the OpenCL formulae using this + pocl and opencl-headers. All the formulae except cf4ocl built without much fuss, and the problem with cf4ocl seems unrelated to how we are packaging OpenCL.

During the testing things did not work quite as well. clinfo, clfft and hashcat all threw some sort of error because they couldn't find an OpenCL device. I'm not yet sure if this because they don't know to search HOMEBREW_PREFIX/etc/OpenCL/vendors or because of some other issue with pocl. I'll be looking into this more but @cho-m let me know if you have any other thoughts.

@cho-m
Copy link
Member Author

cho-m commented Jul 14, 2022

During the testing things did not work quite as well. clinfo, clfft and hashcat all threw some sort of error because they couldn't find an OpenCL device. I'm not yet sure if this because they don't know to search HOMEBREW_PREFIX/etc/OpenCL/vendors or because of some other issue with pocl. I'll be looking into this more but @cho-m let me know if you have any other thoughts.

Not sure. I was able to use clinfo and hashcat in Linux Docker container with just having dependencies.

It was even possible to build clinfo without adding dependencies to formula and get it to run (due to HOMEBREW_PREFIX/lib in RPATH). In this example, you can see it fail once ocl-icd is unlinked:

$ clinfo
Number of platforms                               1
  Platform Name                                   Portable Computing Language
  Platform Vendor                                 The pocl project
  Platform Version                                OpenCL 3.0 PoCL 3.0-rc2  Linux, Release, RELOC, LLVM 14.0.6, SLEEF, DISTRO, POCL_DEBUG
...
ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.1
  ICD loader Profile                              OpenCL 3.0

$ brew unlink ocl-icd
Unlinking /home/linuxbrew/.linuxbrew/Cellar/ocl-icd/2.3.1... 10 symlinks removed.

$ clinfo
clinfo: error while loading shared libraries: libOpenCL.so.1: cannot open shared object file: No such file or directory

@danielnachun
Copy link
Contributor

Not sure. I was able to use clinfo and hashcat in Linux Docker container with just having dependencies.

It was even possible to build clinfo without adding dependencies to formula and get it to run (due to HOMEBREW_PREFIX/lib in RPATH). In this example, you can see it fail once ocl-icd is unlinked:

$ clinfo
Number of platforms                               1
  Platform Name                                   Portable Computing Language
  Platform Vendor                                 The pocl project
  Platform Version                                OpenCL 3.0 PoCL 3.0-rc2  Linux, Release, RELOC, LLVM 14.0.6, SLEEF, DISTRO, POCL_DEBUG
...
ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.1
  ICD loader Profile                              OpenCL 3.0

$ brew unlink ocl-icd
Unlinking /home/linuxbrew/.linuxbrew/Cellar/ocl-icd/2.3.1... 10 symlinks removed.

$ clinfo
clinfo: error while loading shared libraries: libOpenCL.so.1: cannot open shared object file: No such file or directory

Okay that's very helpful to know. I'll double check this and see if I can get clinfo, hashcat and clfft to work. If there's no issues with them I think we will be very close to merging this!

@danielnachun
Copy link
Contributor

I was able to get hashcat and clinfo to work after upgrading the pocl formula to 3.0. The test binary for clfft still segfaults, possibly because it still isn't detecting an OpenCL device. However I think there is enough evidence that this is working as expected that I'm ready to approve this once we resolve the etc issue.

s += <<~EOS
No OpenCL implementation is pre-installed, so all dependents will require either
installing a compatible formula or creating an ".icd" file mapping to a manually
installed option. A portable implementation is available via the `pocl` formula.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rephrase this to:

No OpenCL implementation is pre-installed, so all dependents will require either
installing a compatible formula or creating an ".icd" file mapping to an externally
installed implementation. Any ".icd" files copied or symlinked into 
`#{etc}/OpenCL/vendors` will automatically be detected by `ocl-icd`. A portable
OpenCL implementation is available via the `pocl` formula.

Please fix anything that may be incorrect there!

Copy link
Contributor

@danielnachun danielnachun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ready to publish now.

@BrewTestBot
Copy link
Member

:shipit: @danielnachun has triggered a merge.

@cho-m cho-m deleted the ocl-icd branch July 19, 2022 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. new formula PR adds a new formula to Homebrew/homebrew-core ruby Ruby use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants