Any OpenCL SDKs for FreeBSD?

Hello,

Alright, so I'm learning OpenCL from this book:

It seems that I need an OpenCL SDK, couldn't find any for FreeBSD for AMD GPU.

Thanks for any advice.

Edit:
Did some heavy research, hope this might help anyone doing OpenCL work:

Here are some outputs:

$ clinfo
https://pastebin.com/sWH0grxc

I installed opencl from ports (I assume this is the header files):
$ pkg info -lx opencl
https://pastebin.com/2K5AFjsv

I installed ocl-icd from ports (I assume this is for the latest OpenCL binary driver version):
$ pkg info -lx ocl-icd
https://pastebin.com/PekwJb9M

I installed clover from ports (This is the old OpenCL 1.1 version binaries provided by MESA):
$ pkg info -lx clover
https://pastebin.com/DBKexapQ

I'm not sure if I should use ocl-icd OpenCL binaries, since it did not mention anything about AMD GPU.
Oddly enough, I did some research and it seems that AMD's GPU GitHub page does provide the OpenCL SDK only for the header files and binaries:
https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases

Which I downloaded: lightOCLSDK.zip and extracted it.
These are all the files and subdirectories which contains in the extracted lightOCLSDK.zip: https://pastebin.com/qQ31UY6n
I do not think this will work on FreeBSD or Linux since the OpenCL.lib contains OpenCL.dll, which is for windows OS.

Here I found the AMD SDK 3.0 archived Linux installer from GitHub discussion: https://github.com/fireice-uk/xmr-stak/issues/1511
There, I was able to download the 187 MB compressed file provided from the user "KOLANICH": AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2

After extracting I only get one file: AMD-APP-SDK-v3.0.130.136-GA-linux64.sh

However I can not install it and gives an error (as expected since I am using Unix): https://pastebin.com/NS7xdhA8
I wonder if I can somehow extract the OpenCL library from it and able to manually compile/port it to FreeBSD.
 
Caution: I have not tried this on FreeBSD:


Worst case is your kernels will run on this emulator:


I have no idea how the opencl library detects GPUs but now you've go me curious.
 
Thanks but the first link seems to be only the header files, from my understanding is that mesa drivers which provides the amd GPU driver also make the opencl implementation for the GPU as well which they call it “clover”. I installed “clover” from fresh ports:
but have no idea how to make all of this work as an “OpenCL SDK”.

“clinfo” detects the amd GPU as OpenCL 1.1 provided by mesa clover.

I also found out that the group who makes the OpenCL standard also provides an “OpenCL SDK” of their own:

But I get an error after “cmake ..” stating:

Code:
Unix Makefiles

  does not support platform specification, but platform

    x64

  was specified.
 
Thanks, alright I’ll do that. I guess the “ocl-icd” port you linked should provide OpenCL version 2.0 driver for the amd GPU I have, since the GPU is advertised to support up to version 2.0

Hope everything works throughout the book, I bet the sample codes uses OpenCL 1.1, since the book was published on November 13, 2011. (However I’m also reading OpenCL books published since 2015).
 
However I can not install it and gives an error (as expected since I am using Unix): https://pastebin.com/NS7xdhA8
I wonder if I can somehow extract the OpenCL library from it and able to manually compile/port it to FreeBSD.
For starters, check your pastebin... I'm seeing this right now:
1664983380496.png

This looks like it dumps core at the end. I spent some time trying to solve that, saw some info that I'd need an x570 chipset (I had a B350 at the time).
 
Seems like the pastebin was false reported and taken down... wired.

I was able to successfully install the Khrono's OpenCL SDK:

I originally made a report issue about it and one of the devs helped solved the issue:

Seems like the devs will patch it on the next release so that it can easily be installed on FreeBSD.

But I read that a SDK is not needed, just the OpenCL headers and the AMD OpenCL binaries (via Clover) is all thats needed, which "unitrunker" was preferring me to do.

Any how, not sure whats so special about "Khrono's OpenCL SDK" now that it is fully installed on FreeBSD, we should make a port for it, since after all Khronos is the maintainer and the group who creates/updates the OpenCL standard.
 
For anyone else stumbling across this thread ...

I've not found GPU support for Haswell so I must fall back to using the oclgrind emulator.

I already had clang.

Installed clinfo, ocl-icd, and oclgrind. If clinfo shows no platforms, run it with oclgrind prefix to use the emulator:
oclgrind clinfo
Compile your "hello world" opencl sample code:
c++ main.cpp -I/usr/local/include -L/usr/local/lib -lOpenCL -o main
... and run with the oclgrind prefix:
oclgrind ./main
 
Back
Top