cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

pwvdendr
Adept II

Gentoo OpenCL drivers without GPU (so CPU-only)

I have access to a new university machine which runs 4x AMD® Opteron™  6212 processors, but has no separate GPU. And now I'd need to get OpenCL working here. The machine runs Gentoo linux, this may be a bit of an unhappy choice but I have no say in that.

I wonder how find and install the proper OpenCL drivers. I can find drivers for the AMD GPUs, but there is no separate GPU, so that's probably not the best idea. I can find drivers for the Intel CPUs, but they are AMD CPUs. I can find windows-only drivers with auto-detect, so which work for just the CPU, but they are windows-only and I run Gentoo linux.

So how should I find and install the drivers to actually run my programs on this new machine?

0 Likes
1 Solution

Problem solved: somewhere deeply hidden, I found a package x11-drivers/ati-drivers.

So running "emerge x11-drivers/ati-drivers" solved the problem. Now clinfo() runs correctly. 🙂

View solution in original post

0 Likes
11 Replies

While we don't support this OS, so I cannot guarantee that it will work, try installing the SDK here:

http://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspx

MicahVillmow wrote:

While we don't support this OS, so I cannot guarantee that it will work, try installing the SDK here:

http://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspx

I did that, but when running any OpenCL program (with JOCL) I get

Exception in thread "main" org.jocl.CLException: CL_PLATFORM_NOT_FOUND_KHR

   at org.jocl.CL.checkResult(CL.java:569)

   at org.jocl.CL.clGetPlatformIDs(CL.java:1869)

does this mean that I cannot run OpenCL on Gentoo, or are there other things I can still try? I tried rebooting but this changed nothing.

0 Likes

You need to make sure that the ICD is installed correctly.  In the linux tar.gz package there should be an icd registration script or you can search the forums for help on manually registering the ICD. Also I believe our installation documentation specifies how to do this.

0 Likes

I just re-ran the installer (removing every "sudo" from the installer file -- as gentoo doesn't have a sudo command and I run as root anyway) and I conclude from the output that ICD was done correctly. Also, I have the two files in /etc/OpenCL/vendors/, and it seems this is all that needs to be done for ICD registration? But the error remains, even after rebooting again.

evarist ~ # ./Install-AMD-APP.sh

64-bit Operating System Found..

Starting Installation of AMD APP....

SDK package name is :AMD-APP-SDK-v2.6-RC3-lnx64.tgz

Current directory path is  : /home/pvroot

Untar command executed succesfully, The SDK package available

Untar command executed succesfully, The ICD package available

Copying files to /opt/AMDAPP/ ...

SDK files copied successfully at /opt/AMDAPP/

Updating Environment vairables...

32-bit path is :/opt/AMDAPP/lib/x86

64-bit path is :/opt/AMDAPP/lib/x86_64

Environment vairables updated successfully

ldconfig: Can't stat /usr/lib64/opengl/xorg-x11/lib: No such file or directory

ldconfig: Path `/usr/local/lib64' given more than once

ldconfig: Path `/lib' given more than once

ldconfig: Path `/usr/lib' given more than once

ldconfig: Path `/lib' given more than once

ldconfig: Path `/lib64' given more than once

ldconfig: Path `/usr/lib' given more than once

ldconfig: Path `/usr/lib64' given more than once

AMD APP installation  Completed

>> Reboot recommanded to reflect the changes

>> Please ignore the ldconfig errors, Expected behaviour

>> Please refer the 'AMDAPPlog file' in the same directory

>> Refer the README.txt in the same directory for more info

And the AMDAPPlog file contains the following.

1 )Starting Installation of AMD APP....

2 )64-bit Operating System Found..

3 )Untar command executed succesfully, The SDK package available

4 )Untar command executed succesfully, The ICD package available

5 )SDK Binaries/Source/Samples/Other files copying to  = /opt/AMDAPP

6 )SDK files copied successfully at /opt/AMDAPP/

7 )Copying the OpenCL runtime files to System... 

8 )Updating Environment vairables...

9 )Updating LD_LIBRARY_PATH in /etc/profile

10 )Environment vairables updated successfully

11 )Initialize global environment vairables...

12 )Global environment vairables Initialized

13 )AMD APP installation Completed

14 )Reboot required to reflect the changes

Any idea what could be the cause or what I could try to resolve it?

0 Likes

That install script is really terrible (sorry amd guys, but seriously, it's really really bad).  At a bare minimum the main tar file should include the files in a subdirectory of the same name ...

It's easier just to untar the files directly to where you want them and not splat them all over your system directories.  It runs just fine self-contained.  Unfortunately after you've run it you're left with stuff all over the place and need to remove it manually.  You definitely don't need to reboot to install a few files.

Untar the main .tgz file to a temp directory.

Untar the AMD-APP-SDK*tgz file to where you want it to live, e.g. /usr/local, /opt, ~/.

cd /usr/local

tar xzf /path/to/AMD-APP*.tgz

Untar the icd-registration.tgz to /

cd /

tar xzf /pth/to/icd-registration.tgz

Add the lib dir from where you expanded the sdk to a new file /etc/ld.so.conf.d/amdsdk.conf

e.g. if in /usr/local, it might be

/usr/local/AMD-APP-SDK-v2.6-RC3-lnx64/lib/x86_64

If you're using amd64 arch.

run ldconfig

If you care to, add the bin/x86_64 directory and the tools/AMDAPPProfiler-2.4/x86_64 to your path.

If your demo's still don't run, try bin/x86_64/clinfo, at least that will rule out application problems.

0 Likes

If your demo's still don't run, try bin/x86_64/clinfo, at least that will rule out application problems.

I did exactly what you said, but I get the same problem:

evarist bin # clinfo

terminate called after throwing an instance of 'cl::Error'

  what():  clGetPlatformIDs

Aborted

which is not very surprising since what you describe does technically the same as the install script, except for different directory choices, no?

0 Likes

try using strace to see what files/libraries it's opening.

strace -e open clinfo > /dev/null

To see if it's opening anything, and the right ones.

Amongst other stuff, mine opens libOpenCL, then some c libraries, then /etc/vendors/*.icd, and libamdocl64.so after that.

0 Likes

notzed wrote:

try using strace to see what files/libraries it's opening.

strace -e open clinfo > /dev/null

To see if it's opening anything, and the right ones.

Amongst other stuff, mine opens libOpenCL, then some c libraries, then /etc/vendors/*.icd, and libamdocl64.so after that.

This opens a lot of things and complains they're not there, while at least some of them clearly are. And I have an account with root access, so permissions should not be a problem.

evarist ~ # strace -e open clinfo > /dev/null

open("tls/x86_64/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("tls/libOpenCL.so.1", O_RDONLY)    = -1 ENOENT (No such file or directory)

open("x86_64/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("libOpenCL.so.1", O_RDONLY)        = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/tls/x86_64/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/tls/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/x86_64/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/tls/x86_64/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/tls/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/x86_64/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libOpenCL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY)      = 3

open("/usr/local/AMD-APP-SDK-v2.6-RC3-lnx64/lib/x86_64/libOpenCL.so.1", O_RDONLY) = 3

open("tls/x86_64/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)

open("tls/libpthread.so.0", O_RDONLY)   = -1 ENOENT (No such file or directory)

open("x86_64/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)

open("libpthread.so.0", O_RDONLY)       = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/libpthread.so.0", O_RDONLY) = 3

open("tls/x86_64/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)

open("tls/libstdc++.so.6", O_RDONLY)    = -1 ENOENT (No such file or directory)

open("x86_64/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)

open("libstdc++.so.6", O_RDONLY)        = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libstdc++.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6", O_RDONLY) = 3

open("tls/x86_64/libm.so.6", O_RDONLY)  = -1 ENOENT (No such file or directory)

open("tls/libm.so.6", O_RDONLY)         = -1 ENOENT (No such file or directory)

open("x86_64/libm.so.6", O_RDONLY)      = -1 ENOENT (No such file or directory)

open("libm.so.6", O_RDONLY)             = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/libm.so.6", O_RDONLY)      = 3

open("tls/x86_64/libdl.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)

open("tls/libdl.so.2", O_RDONLY)        = -1 ENOENT (No such file or directory)

open("x86_64/libdl.so.2", O_RDONLY)     = -1 ENOENT (No such file or directory)

open("libdl.so.2", O_RDONLY)            = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libdl.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libdl.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/libdl.so.2", O_RDONLY)     = 3

open("tls/x86_64/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("tls/libgcc_s.so.1", O_RDONLY)     = -1 ENOENT (No such file or directory)

open("x86_64/libgcc_s.so.1", O_RDONLY)  = -1 ENOENT (No such file or directory)

open("libgcc_s.so.1", O_RDONLY)         = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/libgcc_s.so.1", O_RDONLY)  = 3

open("tls/x86_64/libc.so.6", O_RDONLY)  = -1 ENOENT (No such file or directory)

open("tls/libc.so.6", O_RDONLY)         = -1 ENOENT (No such file or directory)

open("x86_64/libc.so.6", O_RDONLY)      = -1 ENOENT (No such file or directory)

open("libc.so.6", O_RDONLY)             = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/libc.so.6", O_RDONLY)      = 3

open("/etc/OpenCL/vendors", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3

open("/etc/OpenCL/vendors/amdocl64.icd", O_RDONLY) = 4

open("tls/x86_64/libamdocl64.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("tls/libamdocl64.so", O_RDONLY)    = -1 ENOENT (No such file or directory)

open("x86_64/libamdocl64.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("libamdocl64.so", O_RDONLY)        = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libamdocl64.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libamdocl64.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY)      = 5

open("/usr/local/AMD-APP-SDK-v2.6-RC3-lnx64/lib/x86_64/libamdocl64.so", O_RDONLY) = 5

open("tls/x86_64/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("tls/libGL.so.1", O_RDONLY)        = -1 ENOENT (No such file or directory)

open("x86_64/libGL.so.1", O_RDONLY)     = -1 ENOENT (No such file or directory)

open("libGL.so.1", O_RDONLY)            = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/tls/x86_64/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/tls/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/x86_64/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/lib64/libGL.so.1", O_RDONLY)     = -1 ENOENT (No such file or directory)

open("/usr/lib64/tls/x86_64/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/usr/lib64/tls/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/usr/lib64/x86_64/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/usr/lib64/libGL.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/etc/OpenCL/vendors/amdocl32.icd", O_RDONLY) = 4

open("tls/x86_64/libamdocl32.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("tls/libamdocl32.so", O_RDONLY)    = -1 ENOENT (No such file or directory)

open("x86_64/libamdocl32.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("libamdocl32.so", O_RDONLY)        = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86_64/libamdocl32.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/opt/AMDAPP/lib/x86/libamdocl32.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY)      = 5

open("/lib64/libamdocl32.so", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/usr/lib64/libamdocl32.so", O_RDONLY) = 5

terminate called after throwing an instance of 'cl::Error'

  what():  clGetPlatformIDs

--- {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=43181, si_uid=0} (Aborted) ---

+++ killed by SIGABRT +++

Aborted

0 Likes

Problem solved: somewhere deeply hidden, I found a package x11-drivers/ati-drivers.

So running "emerge x11-drivers/ati-drivers" solved the problem. Now clinfo() runs correctly. 🙂

0 Likes

Yeah it's supposed to spit out a pile of errors: it's searching the

library path in order.

However it's obvious one thing is failing: it's not finding libGL.so.1.

I suppose one has to install any libGL.so.1, e.g. from mesa.

(i'm only guessing here though)

That would certainly make sense. The only error shown by the installer was about missing openGL, and the command I used to solve the issue installed mesa as a dependency. 🙂

0 Likes