Topics

Hello everyone, new member here...Anyone have experience getting OpenCL running on Debian/Ubuntu?

Hank Quinlan
 

Hello, i've been using Ubuntu for approx 2 years, still learning a lot.

Wondering if anyone knows how, or a good guide to getting OpenCL runtime on Ubuntu 16.04 / 18.04?

Thanks!

Gordon Haverland
 

On Wed, 25 Sep 2019 20:47:16 -0700
"Hank Quinlan via Groups.Io" <hankquinlan=protonmail.com@groups.io>
wrote:

Hello, i've been using Ubuntu for approx 2 years, still learning a
lot.

Wondering if anyone knows how, or a good guide to getting OpenCL
runtime on Ubuntu 16.04 / 18.04?
I think you need to explain a bit more. First off, what kind of GPU
are you talking about? Are you wanting to use Mesa3D to provide
OpenCL? Are you wanting to use proprietary drivers? AMD also has a
middle ground, where only some of the packages in their proprietary
package get installed (I think that gets called legacy).

Are you writing code yourself? Are you intending to use OpenCL via
something like Python?

I suspect you will need some version of CLANG and LLVM installed.

--

Gord

Gordon Haverland
 

As the OP hasn't replied, this isn't terribly relevant.

I have 44 amd64 cores with R460, R550 and R570 GPUs. My attempts at
OpenCL will start with fully Open Source. So, mostly amdgpu and Mesa3D
as far as "drivers" goes.

To date, most of the OpenCL I have run, is BOINC. I have no time for
projects in the summer. So, today I went looking for benchmarks for
OpenCL, and I am looking at that here.

GeekBench talks about OpenCL and Vulkan benchmarks for GPUs. They
assume some particular Ubuntu. I run Devuan/Ceres (unstable). OpenCL
crashed, and Vulkan had problems as well.

Hetero-Mark compiles here. The instructions to run it, don't work. I
can find no forums, wiki or other which discusses this, so time to
delete it and move to next thing.

--

Gord

Gordon Haverland
 

LuxMark has some instructions. In there, it says it needs LuxRays.
And no link or instructions as to how to get LuxRays.

It seems that LuxRays is part of LuxCore. Fine, download zip archive
of LuxCore. As is typicaly, missing -dev packages trip the compiling.
Along comes the message, no Intel Embree. Contrary to assumptions, I
gather Intel Embree will compile on non-Intel CPUs. There is a closed
bug about how to turn off Intel Embree, which never even attempts to
answer the question. So, I am going to try and install the Intel
Embree, which is at a git* archive.

--

Gord

Gordon Haverland
 

On Thu, 26 Sep 2019 19:31:15 -0700
"Gordon Haverland" <ghaverla@...> wrote:

So, I am going to try and install the Intel
Embree, which is at a git* archive.
Embree compiling needs to disable ISPC support. Next question up is
glfw support. Debian has that, so I will see if it works here.

--

Gord

Gordon Haverland
 

That gets me past cmake.

In order to have OpenCL via Mesa3D, I think you need CLANG and LLVM
installed (I don't know if OpenMP is required, I believe that is part
of LLVM). Embree will work with GCC or CLANG/LLVM. If you want to
change from the default CC on Linux (which is gcc), it has to be done
on the first pass of CMAKE (probably by an environment variable or a
command line define). Alternatively, you could use ccmake, which might
be friendlier.

If you install to /usr/local (which is where local changes are supposed
to go), you need to make sure that LD_LIBRARY_PATH has /usr/local in
it. But, the Intel Embree documentation prefers that people install
into /usr, which I think is stupid.

Anyway, for Embree, cmake requires a make to actually build things.
So, make is grinding away as I write this.

Note: for some of this, there are premade binaries. They probably
assume things like Ubuntu. I have no idea if they would work here. I
am building all these prerequisites from source.

--

Gord

Gordon Haverland
 

On Wed, 25 Sep 2019 20:47:16 -0700
"Hank Quinlan via Groups.Io" <hankquinlan=protonmail.com@groups.io>
wrote:

Hello, i've been using Ubuntu for approx 2 years, still learning a
lot.
I'm stacking up a bunch of peripheral things related to OpenCL, waiting
for you to answer some questions about what it is you want. I am
replying to ALL with this note, thinking you are not subscribed to ELUG
and hence haven't seen any of my replies.

--

Gord

Gordon Haverland
 

On Thu, 26 Sep 2019 09:20:10 -0700
"Gordon Haverland" <ghaverla@...> wrote:

n Wed, 25 Sep 2019 20:47:16 -0700
"Hank Quinlan via Groups.Io" <hankquinlan=protonmail.com@groups.io>
wrote:
Replying to ALL, I get a bounce saying @hankquinlan
doesn't exist. So, I guess we just got spammed. Sorry.

I'll keep up the play by play on trying to get OpenCL benchmarks going,
in case it is of interest.

--

Gord

Gordon Haverland
 

Make install puts Embree in /usr/local like I want. Do you know pushd
and popd commands for pushing and popping directories off a stack the
shell maintains? If you pushd without an argument, if swaps the top
two arguments to the directory stack and changes directories to what
was the second directory on the stack. I think the forth description
of this is "rot".

Anyway, I rot-ated back to LuxCore, and did another cmake. It sees
that Embree is installed, by gives an error on Oidn. Oh bother.
Looking for where this comes from, I see the Intel Oidn is yet another
project. So, I will need to work at that. The cmake source file then
shows a possible fatal error on Intel TBB and another on C-BLOSC.

Oidn won't build (at the moment), there is a missing cmake makefile.txt
(or whatever they call them). But, Oidn depends on TBB, so that would
have stacked up another pre-equisite. Debian may have TBB as package.

But, who knows when Oidn can compile again? Could be tomorrow, could
be a month from now.

At this point, LuxMark cannot be looked at as a benchmark for OpenCL,
or its source code as an example of how to write OpenCL.

--

Gord

Hank Quinlan
 

Hello, sorry i don't check emails except every couple days

i'm running an AMD on older laptop, not developing my own python, just mashing around getting to know how linux works a little better.  tried installing hashcat, but wouldn't run without OpenCL.

I will check on CLANG and LLVM thank you

I think maybe a ROCM might be involved too.

Gordon Haverland
 

On Fri, 27 Sep 2019 16:17:11 -0700
"Hank Quinlan via Groups.Io" <hankquinlan=protonmail.com@groups.io>
wrote:

Hello, sorry i don't check emails except every couple days
I wonder why Reply-All bounced?

i'm running an AMD on older laptop, not developing my own python,
just mashing around getting to know how linux works a little better.
tried installing hashcat, but wouldn't run without OpenCL.

I will check on CLANG and LLVM thank you

I think maybe a ROCM might be involved too.
Hashcat, sounds like bitcoin mining. There may be specific documents
on that.

My systems are AMD CPU and AMD GPU. You haven't said what your GPU
is. The older AMD GPU could do some OpenSource stuff, but it seemed
most people who were serious about OpenCL went the proprietary route.
Fglrx and Catalyst were the two descriptions I know for this
proprietary path. I did not have any joy getting that to work on a
machine which had 2 GPU in it (an A10 and a R7-250).

I would guess that for most people, you probably should consider
fglrx/Catalyst to be deprecated.

The newer AMD GPU tend to be called GCN (although the first GCN
generation is in some ways special, and possibly problematic). The
"driver" that works with the kernel is amdgpu. AMD has a proprietary
driver which could be called amdgpu-pro. ROCm often gets mentioned
with this proprietary interface. It seems that it is now possible to
install just the "Open Source" parts, which I think is called legacy.

AMD had a project called HCC, which was a "C" compiler for these
hetrogenous applications. The git page for the project, says HCC is
deprecated. HIP is a newer AMD project with a git page, which is still
written as if HCC is still in use. There is a big report on this,
which does not answer the question. HIP is supposed to be usable for
both AMD and Nvidia GPU.


It is entirely possible that for people who are not programmers, that
they may not need to install CLANG/LLVM. But, from what I've seen on
the Mesa3D mailing list, all the shaders and what not that get used by
a computer are compiled by CLANG/LLVM. Not GCC. Now whether this
means a Debian (Ubuntu, ...) maintainer would be compiling those
things, and making them part of the package; or that the user needs to
have CLANG/LLVM installed because some of this is Just-In-Time (or
similar), I don't know.


That (and the stuff I wrote yesterday) is a lot to digest. If you
could indicate what things seem interesting, and of that, what you
understand; that would be nice. I can then try to make things more
clear. And, I may be able to find installation instructions once I
figure out what you are doing.


For me, I will probably need to write my own code, or modify existing
code, to make use of CPU and GPU on my network.

--

Gord

Hank Quinlan
 

So i got an old desktop from my neighbour and threw xubuntu on it

instead of installing hashcat from the apt install hashcat  standard method, i downloaded and installed the binaries manually and managed to configure OpenCL and it worked!  i can't believe it!

thank you for all your help!