unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Fis Trivial <ybbs.daans@hotmail.com>
To: Fis Trivial <ybbs.daans@hotmail.com>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>,
	Joshua Branson <jbranso@fastmail.com>
Subject: Re: Have GPGPU support in guix?
Date: Mon, 30 Apr 2018 04:51:40 +0000	[thread overview]
Message-ID: <BLUPR16MB0500435410747900908E406E92820@BLUPR16MB0500.namprd16.prod.outlook.com> (raw)
In-Reply-To: <BLUPR16MB0500D649E6411B47B00F588892820@BLUPR16MB0500.namprd16.prod.outlook.com>


Fis Trivial writes:

> Ludovic Courtès writes:
>
>> Hi,
>>
>> Fis Trivial <ybbs.daans@hotmail.com> skribis:
>>
>>>>> However, I wanted to manage all of these with guix so that we can have a
>>>>> unified dependency tree. Currently there are a few options for OpenCL
>>>>> runtime. Namely, beignet, neo from Intel, ROCm stack from AMD, the POCL
>>>>> project and the implementation in mesa.
>>>>>
>>>>> I tried to package beignet (an old OpenCL runtime from Intel) but it
>>>>> wasn't successful due to failed tests (it failed from recognizing
>>>>> device).
>>>>> https://github.com/trivialfis/guixpkgs/blob/master/opencl.scm
>>>>
>>>> Regarding failed tests, I think that tests that expect GPU devices to be
>>>> able are likely to fail: it could be that the relevant /dev nodes are
>>>> inaccessible to the build users, or, more importantly, it could be that
>>>> we’re building on a GPU-less machine such as our build farm.  So these
>>>> tests would have to be skipped.
>>>
>>> I think we might need a better scheme other than skipping tests to
>>> verify the usability of these packages. If we skip tests for OpenCL
>>> runtime, then all the other packages (I promise it will be A LOT) that
>>> depend on it will need to skip their tests, since they won't run without
>>> a proper runtime, resulting in a whole tree of untested packages. And
>>> these thing break easily, due to the fact that they usually rely on
>>> specific version of Clang and LLVM, and many of them still in heavy
>>> development stage.
>>
>> Are you sure?  What I would expect is that packages would be able to use
>> the OpenCL run-time, they’d even be able to run OpenCL code as part of
>> their tests, only it would run on the main CPU instead of on GPUs, as if
>> the machine had no usable GPUs.
>>
>> Does that make sense?
>>
>> Thanks,
>> Ludo’.
>
> In most of the time, we have two way to run these packages on CPU, For
> the first one:
>
> Most of the packages have a CPU backend and an OpenCL backend,
> implementing same algorithms twice, so when OpenCL device is not
> available, they will run on their CPU backend. And the normal testing
> scheme for these packages is doing the same tests for each backend, but
> do them independently. So, if we were to put these packages in Guix, we
> could run the tests for CPU backend.
>
> For the second one:
>
> OpenCL implementations (the compiler) have a fall back mode, which means
> they can treat CPU as the device and compile OpenCL code to run it on
> CPU. I think this is what you meant by the line "run OpenCL code as part
> of their tests". This feature is provided by the OpenCL compiler, which
> we currently can't test.
>
> I'm still trying to package a basic OpenCL stack. And I did success in
> run some very primitive tests from myself outside of the store. But
> still, there are a lots of stuffs I need to learn.

And to make things more complicated, developers can choose platforms(the
implementations), device at runtime, if the package developers choose to
run the code with GPU, then falling back to CPU won't happen. I'm
thinking putting tests executable as a separated output for those who
want to run tests. But simply copying executable files will result in
wrong rpath, which is another thing I don't know how to deal with.

Currently, using clinfo (A little utility used to display information
about existing OpenCL vendor information) to display information about
*beignet* and *pocl* is working, which means calling basic functions
with packages in the store is working. You can check the code
in (or would it be more convenient if I open a bug report and drop the
code there?):

https://github.com/trivialfis/guixpkgs/blob/master/opencl.scm

I also put a readme file in that repository.

  reply	other threads:[~2018-04-30  4:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-24 23:22 Have GPGPU support in guix? Fis Trivial
2018-04-24 23:29 ` Joshua Branson
2018-04-24 23:32   ` Fis Trivial
2018-04-24 23:46     ` Joshua Branson
2018-04-25 12:41   ` Ludovic Courtès
2018-04-25 22:38     ` Fis Trivial
2018-04-26 12:46       ` Ludovic Courtès
2018-04-26 17:59         ` Fis Trivial
2018-04-29 17:07           ` Ludovic Courtès
2018-04-30  0:10             ` Fis Trivial
2018-04-30  4:51               ` Fis Trivial [this message]
2018-04-25 17:17 ` Ricardo Wurmus
2018-04-25 18:04   ` Tobias Platen
2018-04-25 22:25     ` Joshua Branson
2018-04-26  3:18       ` Pierre Neidhardt
2018-04-26  6:21         ` Jonathan Brielmaier
2018-04-26  6:34           ` Pierre Neidhardt
2018-04-26  8:04           ` Mark H Weaver
2018-04-26  8:36             ` Jonathan Brielmaier
2018-04-27  3:31               ` Chris Marusich
2018-04-30 18:00                 ` Thompson, David
2018-04-25 22:51     ` Fis Trivial
2018-04-25 22:50   ` Fis Trivial

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BLUPR16MB0500435410747900908E406E92820@BLUPR16MB0500.namprd16.prod.outlook.com \
    --to=ybbs.daans@hotmail.com \
    --cc=guix-devel@gnu.org \
    --cc=jbranso@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).