cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

drnil
Adept I

Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

Many web sites recommend AMD APP SDK for use with AMD GPUs, but I recently learnt that the most recent AMDGPU-PRO driver for Ubuntu 16.04 is incompatible with the AMD APP SDK. Question 1: What would be a suitable Open CL SDK to be used with AMDGPU-PRO?

Incidentally, I use 64-bit Ubuntu 16.04 LTS and for a start, I use a Radeon HD 7870 card. My first test goal would be to run the Matrix* samples included in the AMD APP SDK.

Question 2: Web search indicates that just after installing open cl header files, the libraries included with AMDGPU-PRO may suffice to compile and run the sample programs. Is this correct, and if so what would the command sequence look like?

0 Likes
1 Solution

Accepted Solutions
dipak
Staff
Staff

Re: Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

Please follow the link to download the driver: Desktop  and use APP SDK 3.0 from here: amd-accelerated-parallel-processing-app-sdk

I completely agree with you that those information should have been clearly mentioned on the release note. I already informed the concerned team earlier, however it doesn't seem to have been updated yet.

View solution in original post

7 Replies
dipak
Staff
Staff

Re: Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

For header files and libraries, actually, you don't need any SDK with amdgpu-pro. Libraries come with the driver and can be found at "/opt/amdgpu-pro/lib/x86_64-linux-gnu/". Whereas, header files can be downloaded from the linux repo by "sudo apt-get install opencl-headers" [typically it places the header files at (/usr/include/CL)]. Now, build the OpenCL programs using the above library and headers. For example, compiling a program from command-line using g++ may look like:   g++ <source.cpp> -L/opt/amdgpu-pro/lib/x86_64-linux-gnu/ -lOpenCL

[Edit]: I've attached "MatrixTranspose" sample as a standalone project that can be built on amdgpu-pro using above steps.

drnil
Adept I

Re: Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

Thank you very much for the extremely quick and helpful replies!

0 Likes
drnil
Adept I

Re: Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

When I compile the program as described, there are several errors "warning: ‘_cl_command_queue* clCreateCommandQueue(...)’ is deprecated" (see below). After I add

    #define CL_USE_DEPRECATED_OPENCL_1_2_APIS

    #include <CL/cl.h>

to the beginning of MatrixTranspose.cpp the warnings go away, but when I run the program, the following is output:

Platform 0 : Advanced Micro Devices, Inc.

Input

15.3732 201.81 51.9855 89.2322 92.572 34.4675 96.2478 66.3863 11.345 225.168 161.374 96.5491 81.8505 211.932 108.827 124.578 202.418 244.549 182.722 90.1216 215.537 92.7693 98.0533 20.0925 44.5603 225.408 55.9775 247.995 202.92 0.896856 45.4356 218.293 202.706 97.4211 51.5251 39.2784 131.889 147.773 105.665 143.234 116.941 11.0383 239.783 198.791 222.97 92.6095 67.3688 169.388 81.1586 250.091 3.50951 40.6953 86.8598 101.563 60.7878 131.42 70.9705 116.765 123.415 17.8903 117.662 168.851 236.183 64.3685

Platform found : Advanced Micro Devices, Inc.

Selected Platform Vendor : Advanced Micro Devices, Inc.

Device 0 : Pitcairn Device ID is 0x1a13d60

Error: clCreateCommandQueue failed.

Location : MatrixTranspose.cpp:152

What would be the right thing to do here? Does the compiler assume Open CL 2.0 while the GPU only accepts Open CL 1.2?

The full error messages from the first compilation were:

g++ *.cpp -L/opt/amdgpu-pro/lib/x86_64-linux-gnu/ -lOpenCL

MatrixTranspose.cpp: In member function ‘int MatrixTranspose::setupCL()’:

MatrixTranspose.cpp:143:24: warning: ‘_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations]

        commandQueue = clCreateCommandQueue(

                        ^

In file included from /usr/include/CL/opencl.h:42:0,

                from CLUtil.hpp:24,

                from MatrixTranspose.hpp:26,

                from MatrixTranspose.cpp:18:

/usr/include/CL/cl.h:1359:1: note: declared here

clCreateCommandQueue(cl_context                    /* context */,

^

MatrixTranspose.cpp:143:24: warning: ‘_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations]

        commandQueue = clCreateCommandQueue(

                        ^

In file included from /usr/include/CL/opencl.h:42:0,

                from CLUtil.hpp:24,

                from MatrixTranspose.hpp:26,

                from MatrixTranspose.cpp:18:

/usr/include/CL/cl.h:1359:1: note: declared here

clCreateCommandQueue(cl_context                    /* context */,

^

MatrixTranspose.cpp:147:35: warning: ‘_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations]

                            &status);

                                  ^

In file included from /usr/include/CL/opencl.h:42:0,

                from CLUtil.hpp:24,

                from MatrixTranspose.hpp:26,

                from MatrixTranspose.cpp:18:

/usr/include/CL/cl.h:1359:1: note: declared here

clCreateCommandQueue(cl_context                    /* context */,

^

0 Likes
dipak
Staff
Staff

Re: Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

With ampdgpu-pro, OpenCL is not supported on SI cards (e.g. Pitcairn). I'm very sorry, I overlooked the actual card number in the previous post.

drnil
Adept I

Re: Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

OK, which is the latest stable driver that supports OpenCL and SI cards, and which versions of Ubuntu and AMD APP SDK go with it?

Edit:

(Perhaps AMDGPU-PRO Driver for Linux® Release Notes should be corrected since it does claim both

AMD Radeon™ Product Compatibility

The AMDGPU-Pro Driver is compatible with the following AMD products.

AMD Product Family Compatibility
Radeon™ RX Vega Series GraphicsAMD Radeon™ Pro WX-series
Radeon™ Vega Frontier EditionAMD FirePro™ W9100
Radeon™ RX 550/560/570/580 Series GraphicsAMD FirePro™ W8100
AMD Radeon™ RX 460/470/480 GraphicsAMD FirePro™ W7100
AMD Radeon™ Pro DuoAMD FirePro™ W5100
AMD Radeon™ R9 Fury/Fury X/Nano GraphicsAMD FirePro™ W4300
AMD Radeon™ R9 380/380X/390/390X GraphicsAMD FirePro™ W4100
AMD Radeon™ R9 285/290/290X GraphicsAMD FirePro™ W2100
AMD Radeon™ R7 240/250/250X/260/260X/350AMD FirePro™ W600
AMD Radeon™ HD7700/7800/8500/8600AMD FirePro™ S-Series
AMD Radeon™ R9 360 GraphicsAMD Radeon™ Pro WX 9100
AMD Radeon™ R5 340

and

Base Feature Support

    • ​Supported
    • APIs:
      • 4
      • OpenCL™1.2
      • Vulkan™ 1.0
      • VDPAU/VAAP

?)

0 Likes
dipak
Staff
Staff

Re: Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

Please follow the link to download the driver: Desktop  and use APP SDK 3.0 from here: amd-accelerated-parallel-processing-app-sdk

I completely agree with you that those information should have been clearly mentioned on the release note. I already informed the concerned team earlier, however it doesn't seem to have been updated yet.

View solution in original post

drnil
Adept I

Re: Recommended Open CL SDK for use with AMDGPU-PRO on Linux?

Jump to solution

Thank you for this information, dipak. I have now succeeded in compiling the MatrixTranspose program.  The procedure is nontrivial though, because the driver requires first downgrading Ubuntu to 14.04, and then further downgrading the Linux kernel to 3.19, plus some other trickery. However, I believe this could be useful for others, so I will post the details in a separate thread later. Thanks a lot again!

0 Likes