Page 1 of 1

[SOLVED] openCL with AMD HD 7770 ?

PostPosted: Dec 15th, '17, 23:01
by hansmicheelsen
Hi, I I'm interested in experimenting with OpenCL. But cannot get it to work. I have this test program which should tell me which Platform I have. But it return "No platform found...". Does anyone know how to setup OpenCL on Mageia?
Is it at all possible to get it working with RadeonSi. Most of the info I find is on Nvidea.

To your info I'm running Cauldron, but I think this question is more related to setup than to Mga version.

Code: Select all
#include <iostream>
#include <vector>
#include <CL/cl.hpp>

using namespace std;

int main(int argc, char** argv) {
    std::vector<cl::Platform> all_platforms;
    cl::Platform::get(&all_platforms);

    if (all_platforms.size() == 0) {
        std::cout << " No platforms found. Check OpenCL installation!\n";
        exit(1);
    }
    cl::Platform default_platform = all_platforms[0];
    std::cout << "Using platform: " << default_platform.getInfo<CL_PLATFORM_NAME>() << "\n";

    return 0;
}

Re: openCL with AMD HD 7770 ?

PostPosted: Dec 16th, '17, 00:34
by doktor5000
It might help if you would at least mention what graphics driver you're using and what steps you took to configure OpenCL yet.

If you don't have the AMD SDK installed then you could grab clinfo somewhere and run that, it will possibly output the same which indicates there's something missing on your system.
I believe the problem is that we don't ship the fglrx driver for mga6 as it hasn't been updated for the most recent X server versions, so you would have to install it manually.

Re: openCL with AMD HD 7770 ?

PostPosted: Dec 16th, '17, 01:16
by hansmicheelsen
Sorry for not being precise. I have installed mesa-17.3.0-1.mga7 and lib64opencl1-2.2.11-1.mga6 inclusive their develop packages. And all available mesa packages except osmesa

The clinfo code starts with exactly the same check (although in c instead of c++). And responds with "Number of platforms 0"

Blast, I thought opencl support came with mesa and the lib64opencl1. Does it work on nvidea on Mageia?

Re: openCL with AMD HD 7770 ?

PostPosted: Dec 16th, '17, 03:09
by doktor5000
Yes, there's at least one thread here where people got it to work with nvidia, see e.g. viewtopic.php?f=15&t=8711

And I believe up to mga5 you could install fglrx-opencl which is the same as if you install the proprietary AMD driver manually plus the necessary opencl stuff for it, I believe.

Regarding libopencl, you may want to read it's man page.
libOpenCL.so is the library linked by OpenCL programs. It does not contains any OpenCL implementation itself, but merly act as a dispatcher to real OpenCL implementations provided as OpenCL Installable Client Driver (ICD). An ICD loader should be able to load ICDs provided by any vendors.


For a general overview, you may also want to look at e.g. https://wiki.tiker.net/OpenCLHowTo

Re: openCL with AMD HD 7770 ?

PostPosted: Dec 16th, '17, 11:53
by hansmicheelsen
That helped.
I downloaded the latest (15.302) fglrx from AMD and followed instructions in https://wiki.tiker.net/OpenCLHowTo very carefully.
And now I get tons of information from clinfo. I have attached the output if someone would like to see it

So now its time to do some experiments with OpenCL. I found a tutorial here: http://simpleopencl.blogspot.dk/2013/06/tutorial-simple-start-with-opencl-and-c.html

Alas, BOINC says "No usable GPU's found". But that's another story. I'll close this thread with [SOLVED]


Thank you doctor5000. You are truly amazing. You have helped me and many other mga-users so many times. Thank you very much!

Yours sincerely
Hans Micheelsen

Re: [SOLVED] openCL with AMD HD 7770 ?

PostPosted: Dec 16th, '17, 12:04
by hansmicheelsen
... and the little tutorial program from http://simpleopencl.blogspot.dk/2013/06/tutorial-simple-start-with-opencl-and-c.html, which adds two vector, works!! Cool!