Subject: Re: [PATCH 0/6] gnu: Add opencl related packages.

From: Fis Trivial <[email-masked]>
Date: Sat, 26 May 2018 17:42:58 +0000

Fis Trivial writes:

> These patches add basic support for opencl. As noted in the new file
> opencl.scm, tests can't enabled by now. For the future, maybe we can
> patch the build system to make test targets installable so that people
> with right tools can help testing. Or maybe there are some other ways
> that we can modify the build environment for testing. But that's another
> day's problem. :)
>
> Although testing with packages' unit tests are not enabled. I tried to
> test them outside the store by simple hello world program, they works
> fine on my hardware.
>
> To make thing a little comfortable, I packaged clinfo, which is a little
> tool for displaying OpenCL platforms and device information by calling
> OpenCL host functions. If it works on your device, then at least you can
> confirm the corresponding implementation is not completely broken.
>
> Environment variable `OPENCL_VENDOR_PATH` is used to guide `ocl-icd`
> loading needed OpenCL implementation library. You need to source it in
> your profile before you try to use any of the implementation.
>
> I wrapped clinfo, notes are put in the package definition.
>

Hi, guixs.

Sorry.

I don't think any usable OpenCL implementation in guix can be done in
recent future. OpenCL is kind of deeply integrated with clang and
llvm. One of the problem of this integration is that ld is not invoked
with correct search path. And usually the link procedure is implemented
by calling llvm APIs since ld doesn't know how to link device binary
objects. Which means if we want to solve this problem we will have to
figure out how does llvm do linking and add the corresponding patches to
make a specialized llvm. If I were to do it, I would rather try to get
ld and gcc support basic OpenCL linking, the needed effort is not that
different.

You can still review these packages without pocl and beignet (these two
are implementation), so that others who want to enable OpenCL in guix
will not have to packages those headers and helper tools.