Ubuntu 16.04 LTS Is Deprecating AMD's fglrx (Catalyst) replacing with amd-gpupro

AgentB
AgentB
Joined: 17 Mar 12
Posts: 915
Credit: 513,211,304
RAC: 0
Topic 198562

Thought i'd start a separate thread for this, as i expect it will cause some problems.

If you don't use Ubuntu (or many derivatives) and AMD-GPUS you not affected.

Some background.

Why Radeon Users May Want to Avoid Ubuntu 16.04 LTS

Phoronix article and askubuntu

The latest AMD news is

AMD Posts Initial AMDGPU Hybrid Driver With Vulkan Support which states

 

Quote:

support only for currently only working for GCN 1.2 GPUs like the Tonga and Fiji hardware. 

If you need to look at which GCN your card is try wiki list

I don't have a GCN 1.2 to play with, so I can't say if these work.

The AMD Beta release page / download is
AMD Radeon™ Software AMD GPU-PRO Beta Driver – Linux® for Vulkan

(Edit: I still don't see this as stating support for 16.04 LTS but i'm guessing it will be Vulkan only for 16.04)

This may (for small values of may) fix the long standing problem with running multiple work units.

AMD have been very vague about when the GCN 1.1 and earlier - get an update.

So if you are in 16.04 LTS and running GCN 1.1 or earlier - there not many good options.

There has been some small success at using Open Source MESA drivers in place of fgrlx, whether that approach will work on 16.04 LTS remains to be seen. There are two MESA threads one over at BOINC forum Why Doesn't and When Will BOINC Support GPUs Via Open-Source OpenCL Drivers?
and here

BRP6-opencl-ati with linux mesa opencl

I don't know if anyone has tried 16.04 LTS (on beta) with the new AMDGPU and GCN 1.2.

Should be interesting...

robl
robl
Joined: 2 Jan 13
Posts: 1,632
Credit: 1,099,788,917
RAC: 679,615

Ubuntu 16.04 LTS Is Deprecating AMD's fglrx (Catalyst) (released

This has saved me a bunch of lost time. I have a single AMD card, Pitcairn, GCN 1.0. I guess I will wait on upgrading that machine to see what falls out along the way.

I will upgrade a Laptop just for the experience of trying Ubuntu's "upgrade" path. I have never successfully upgraded a PC successfully (Win 10 was a breath of fresh air in the upgrade path), but I will give it a try anyway. The laptop is just ....

Aaron Puchert
Aaron Puchert
Joined: 30 May 14
Posts: 13
Credit: 2,634,629
RAC: 107

It's really not that hard

It's really not that hard with Mesa. Einstein@Home is one of the few projects that work with the open source drivers. You need to have some packages at the latest versions, and it's somewhat slower. Other than that, it just works.

The hardest thing is apparently to get BOINC >=7.4, since most Linux distros still ship with 7.2.42. Then you need Mesa 11 and a libclc containing the fix by Paulie (That was merged on 27 Jan 2016, mentioned in https://einsteinathome.org/node/198372&postid=151532). That's it.

AgentB
AgentB
Joined: 17 Mar 12
Posts: 915
Credit: 513,211,304
RAC: 0

RE: The hardest thing is

Quote:
The hardest thing is apparently to get BOINC >=7.4, since most Linux distros still ship with 7.2.42.

Thank Aaron, and welcome. That's not to difficult - i would suggest the easiest way is LocutusOfBorg's ppa

JohnRH
JohnRH
Joined: 20 Mar 05
Posts: 7
Credit: 13,991,336
RAC: 16,540

I would like to comment on

I would like to comment on AgentB's original post 156126. He says "I don't know if anyone has tried 16.04 LTS (on beta) with the new AMDGPU and GCN 1.2." Since I've done this I'd like to set out my experience. I do understand that this is purely anecdotal and may not be true for everyone. (I apologise for the length!)
AgentB is correct that Ubuntu 16.04 has dumped fglrx and replaced it with open-source drivers, but feel that he rather jumped the gun over possible difficulties!
When I did my online upgrade to 16.04 (released) I was at first rather alarmed at the disappearance of fglrx, but since everything seemed to be functioning ok I didn't worry about it. But it all looked different when it came to setting up BOINC so I'll just deal with that.

First, my setup:
Ubuntu 16.04 amd64.
AMD APU A10-7700K Radeon R7 KAVERI.
BOINC 7.6.31.

With earlier Ubuntu's it was never possible to get BOINC to "see" OpenCL. It's fine now, so here's the path I followed.

First, to set up OpenCL. Looking at the BOINC packages, we will need boinc-client-opencl. That recommends mesa-opencl-icd, which I installed along with all its dependencies. This brought amdgpu into play along with other needed packages. Running clinfo gives:
Number of platforms 1
Platform Name Clover
Platform Vendor Mesa
Platform Version OpenCL 1.1 MESA 11.2.0
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix MESA

Platform Name Clover
Number of devices 1
Device Name AMD KAVERI (DRM 2.43.0, LLVM 3.8.0)
Device Vendor AMD
Device Vendor ID 0x1002
Device Version OpenCL 1.1 MESA 11.2.0
Driver Version 11.2.0
Device OpenCL C Version OpenCL C 1.1
Device Type GPU
Device Profile FULL_PROFILE
Max compute units 6
Max clock frequency 720MHz
Max work item dimensions 3
Max work item sizes 256x256x256
Max work group size 256
Preferred work group size multiple 64
Preferred / native vector sizes
char 16 / 16
short 8 / 8
int 4 / 4
long 2 / 2
half 0 / 0 (n/a)
float 4 / 4
double 2 / 2 (cl_khr_fp64)
Half-precision Floating-point support (n/a)
Single-precision Floating-point support (core)
Denormals No
Infinity and NANs Yes
Round to nearest Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Double-precision Floating-point support (cl_khr_fp64)
Denormals Yes
Infinity and NANs Yes
Round to nearest Yes
Round to zero Yes
Round to infinity Yes
IEEE754-2008 fused multiply-add Yes
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Address bits 32, Little-Endian
Global memory size 1073741824 (1024MiB)
Error Correction support No
Max memory allocation 268435456 (256MiB)
Unified memory for Host and Device Yes
Minimum alignment for any data type 128 bytes
Alignment of base address 1024 bits (128 bytes)
Global Memory cache type None
Image support No
Local memory type Local
Local memory size 32768 (32KiB)
Max constant buffer size 268435456 (256MiB)
Max number of constant args 16
Max size of kernel argument 1024
Queue properties
Out-of-order execution No
Profiling Yes
Profiling timer resolution 0ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels No
Device Available Yes
Compiler Available Yes
Device Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_fp64

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Clover
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [MESA]
clCreateContext(NULL, ...) [default] Success [MESA]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1)
Platform Name Clover
Device Name AMD KAVERI (DRM 2.43.0, LLVM 3.8.0)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) Success (1)
Platform Name Clover
Device Name AMD KAVERI (DRM 2.43.0, LLVM 3.8.0)

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.8
ICD loader Profile OpenCL 1.2
NOTE: your OpenCL library declares to support OpenCL 1.2,
but it seems to support up to OpenCL 2.1 too.
...So now all looks good.

Next, the BOINC packages:
boinc
boinc-client-opencl
boinc-manager
boinc-client
libboinc7
... and off we go!

Now here is the start of my Event Log:
Thu 05 May 2016 12:40:41 ICT | | Starting BOINC client version 7.6.31 for x86_64-pc-linux-gnu
Thu 05 May 2016 12:40:41 ICT | | log flags: file_xfer, sched_ops, task
Thu 05 May 2016 12:40:41 ICT | | Libraries: libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Thu 05 May 2016 12:40:41 ICT | | Data directory: /var/lib/boinc-client
Thu 05 May 2016 12:40:45 ICT | | OpenCL: AMD/ATI GPU 0: AMD KAVERI (DRM 2.43.0, LLVM 3.8.0) (driver version 11.2.0, device version OpenCL 1.1 MESA 11.2.0, 1024MB, 1024MB available, 346 GFLOPS peak)
Thu 05 May 2016 12:40:45 ICT | | Host name: john-desktop
Thu 05 May 2016 12:40:45 ICT | | Processor: 4 AuthenticAMD AMD A10-7700K Radeon R7, 10 Compute Cores 4C+6G [Family 21 Model 48 Stepping 1]
Thu 05 May 2016 12:40:45 ICT | | Processor features: ... (edited)
Thu 05 May 2016 12:40:45 ICT | | OS: Linux: 4.4.0-21-generic
...which suggest that all should now be ok with BOINC and OpenCL in Ubuntu 16.04, and it seems to be.

Of course there are caveats. We see below that certain CPU/GPU requirements must be met. The libclc-* packages list the supported hardware.

This post just serves to show that Ubuntu 16.04 and AMDGPU can work together, so maybe the loss of fglrx might not be the end of the world after all.

Now for the bad bit. (There always is!) The projects I'm using are still not sending tasks for AMD/ATI GPU, although everything is otherwise churning happily along. (Namely, LHC, Milkyway, Einstein, SETI.) I don't know why this is, but maybe the subject of another thread.

Finally, good luck and best wishes to anyone still reading this far.

Holmis
Joined: 4 Jan 05
Posts: 1,118
Credit: 791,534,116
RAC: 150,242

RE: ... Now for the bad

Quote:
...
Now for the bad bit. (There always is!) The projects I'm using are still not sending tasks for AMD/ATI GPU, although everything is otherwise churning happily along. (Namely, LHC, Milkyway, Einstein, SETI.) I don't know why this is, but maybe the subject of another thread.


New thread or not, all BRP6 tasks on your machine are erroring with the following stderr:

Quote:

7.6.31

process exited with code 218 (0xda, -38)

[07:16:41][13108][INFO ] Application startup - thank you for supporting Einstein@Home!
[07:16:41][13108][INFO ] Starting data processing...
[07:16:41][13108][INFO ] Using OpenCL platform provided by: Mesa
[07:16:41][13108][INFO ] Using OpenCL device "AMD KAVERI (DRM 2.43.0, LLVM 3.8.0)" by: AMD
[07:16:42][13108][ERROR] Couldn't build OpenCL program (error: -11)!
[07:16:42][13108][INFO ] OpenCL shutdown complete!
[07:16:42][13108][ERROR] Demodulation failed (error: 2010)!
07:16:42 (13108): called boinc_finish(2010)


And because of that your daily quota of tasks has been reduced and will continue to be reduced until you can get the machine actually process the tasks.
As to why the error occurs I'll have to deffer to someone else with more knowledge about the reported error codes.

Aaron Puchert
Aaron Puchert
Joined: 30 May 14
Posts: 13
Credit: 2,634,629
RAC: 107

The error number refers to

The error number refers to (CL/cl.h):
#define CL_BUILD_PROGRAM_FAILURE -11

This is a compiler error for the OpenCL kernel. Unfortunately the compiler log isn't printed, so we can't be sure what the error is. (Dear developers, please use clBuildProgramInfo [1] to retrieve the log and print it to stderr.) But this isn't the first time, so I have a guess.

You really need to make sure that your version of libclc is recent enough. Unfortunately there are no version numbers for libclc, so it's hard to find out. Einstein@home needs a function (fmod) that was only recently added and is not contained in the standard packages for most distros. If in doubt, compile libclc yourself.

You might need some dependencies, like git and make. To my understanding, llvm-devel should not be needed. [2]

git clone http://llvm.org/git/libclc.git
cd libclc/
git checkout b518692
./configure.py
make
sudo make install


Checking out the older commit is needed if you want to build against LLVM 3.8.

As for SETI: this does not work at the moment because the SETI apps use a compiler option only known to the proprietary driver, which isn't even needed for the open source driver. So it could just be removed. And the LLVM compiler seems to have a hard time with inlining. Both problems are relatively easy to solve, but I didn't have the time to contact the developers yet. [3]

[1] https://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetProgramBuildInfo.html
[2] https://dri.freedesktop.org/wiki/GalliumCompute/
[3] https://setiathome.berkeley.edu/forum_thread.php?id=79391

Aaron Puchert
Aaron Puchert
Joined: 30 May 14
Posts: 13
Credit: 2,634,629
RAC: 107

Sorry, the function is

Sorry, the function is actually called clGetProgramBuildInfo, just like the link says.

JohnRH
JohnRH
Joined: 20 Mar 05
Posts: 7
Credit: 13,991,336
RAC: 16,540

Thanks for your help on this

Thanks for your help on this one, also to Holmis.
I went through the procedure you suggested, and now have ver 0.2.0+git20150813-2 for libclc*, which I assume is correct.
I let things run with this for a few days so as to give e@home some time to see if it worked through, but am still getting the same results, like this...

Requesting new tasks for AMD/ATI GPU
Scheduler request completed: got 1 new tasks
Started download of PM0126_02321_182.bin4
Started download of PM0126_02321_183.bin4
Finished download of PM0126_02321_183.bin4
Started download of PM0126_02321.zap
Finished download of PM0126_02321.zap
Finished download of PM0126_02321_182.bin4
[coproc] Assigning ATI instance 0 to PM0126_02321_182_1
Starting task PM0126_02321_182_1
Computation for task PM0126_02321_182_1 finished
Output file PM0126_02321_182_1_0 for task PM0126_02321_182_1 absent
Output file PM0126_02321_182_1_1 for task PM0126_02321_182_1 absent

So I guess it might be a matter of waiting for updates to libclc* to come along, which I assume I'll see through normal updates.

Aaron Puchert
Aaron Puchert
Joined: 30 May 14
Posts: 13
Credit: 2,634,629
RAC: 107

The necessary patch should

The necessary patch should definitely be in there if you checked out the commit I mentioned. Maybe the newly installed libraries are just not used. Could you verify that the folder "/usr/local/lib/clc" exists and contains several "*.bc" files? Then we still don't know if they are loaded. This is really hard to debug without the build log.

I see two options here: One is to beg the developers to print the build log, so we can see what went wrong. The other is to figure it out yourself: If you wouldn't be uncomfortable writing a small C program, we could get the build log and see where the problem is. I could basically write the program myself, but it helps a lot if you have some basic experience in programming.

Aaron Puchert
Aaron Puchert
Joined: 30 May 14
Posts: 13
Credit: 2,634,629
RAC: 107

Maybe this helps to find out

Maybe this helps to find out if the libraries are used: ls -ltu /usr/local/lib/clc/ But access times are not very reliable, so this can only be a hint. Since you seem to have a Kaveri card, the library "kaveri-amdgcn--.bc" should be used, which is a symlink to "tahiti-amdgcn--.bc".

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.