cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

glupescu
Adept I

Kaveri programming HSA OpenCL 2.0

I have an AMD CPU Kaveri A10 7850K (CPU 4C + GPU 8C) with 6GB RAM installed and a discrete GPU alonside R7 265 2GB.

I've installed Ubuntu 14.04 LTS on the system and then the HSA kernel and runtime [1].

I've got the sample working on HSA and from what I understand in order to use OpenCL with the HSA I have to compile the CL code into BRIG/HSA [2].

Looking at the schematics of the software stack describing HSA I don't understand where the GPU driver actually fits in [3]. I mean I can use the GPU in a HSA program without the amdgpu kernel module ? Or is it already installed ? How do OpenCL commands translate into this picture [3] ?

I installed AMD APP SDK 3.0 beta, compiled the provided samples and ofc tried to run them. I get no valid platform/device found.

I then turned to install the fglrx driver from stable or updates - that crashed the X server and I had to remove them. I tried to run OpenCL while they were installed but again received errors no platform/device found.

So to summarize the questions are:

1. Where does the GPU driver fit in the picture [3] from both HSA and OpenCL point of view ?

2. Does the amdkfd control both CPU and GPU ? Who for instance controls the device init and clocks ? Who builds the GPU command queue and sends commands to the GPU ?

3. Can't I use OpenCL and HSA at the same time ? If so what is the proper/working configuration to do this ?

4. Is OpenCL 2.0 supported at the GPU level and if yes in what software configuration (driver, app sdk etc...) ?

5. Is there a place that summarizes all of the configurations aside from wiki/forum/release notes ? There is a lot of information and configurations and you can easily mess things up.

6. Aside from Kaveri A10 7850 have the other CPUs been tested ? For instance on A10 7850 I get "The maximum queue size is 131072." What will I get on A6 7400K ?

Regards,

Grigore

[1] HSAFoundation/HSA-Drivers-Linux-AMD · GitHub

[2] HSAFoundation/CLOC · GitHub

[3] File:Linux AMD graphics stack.svg - Wikipedia, the free encyclopedia

1 Solution
jedwards
Staff

Your statement "I've got the sample working on HSA and from what I understand in order to use OpenCL with the HSA I have to compile the CL code into BRIG/HSA" is incorrect. There is no runtime support for OpenCL on HSA meaning that you cannot take an OpenCL program using either the 1.2 or 2.0 host side APIs and have it interact with HSA or the HSA drivers, even if you port the OpenCL C program to HSAIL. There are tools, CLOC in particular, that allow you to translate device code (kernels) from OpenCL C to HSAIL, but those translated kernels/code can only be launched by the HSA runtime.

Answers to questions:

1. Where does the GPU driver fit in the picture [3] from both HSA and OpenCL point of view ? - The GPU driver is used to directly program the GPU device on the system, but for now the "HSA units" are only programmed by the KFD.

2. Does the amdkfd control both CPU and GPU ? Who for instance controls the device init and clocks ? Who builds the GPU command queue and sends commands to the GPU ? - The KFD only interacts with the GPU. The KFD controls initializing the kernel resources needed to support HSA processes and compute queues, but it shares GPU resources with the graphics driver. The KFD requests command queue resources from the graphics drivers, and exposes the command queue directly to the user (this is a user mode queue). The user sends commands directly to the GPU using the exposed user mode queue via AQL packets.

3. Can't I use OpenCL and HSA at the same time ? If so what is the proper/working configuration to do this ? - You cannot. Right now there isn't a unified driver and there isn't a publicly available version of OpenCL on HSA.

4. Is OpenCL 2.0 supported at the GPU level and if yes in what software configuration (driver, app sdk etc...) ? - I t is supported, but not on top of HSA. Please consult the OpenCL 2.0 installation page and do not use any of the distributed HSA drivers or software.

5. Is there a place that summarizes all of the configurations aside from wiki/forum/release notes ? There is a lot of information and configurations and you can easily mess things up. - From the HSA point of view you can look here: Home · HSAFoundation/HSA-Docs-AMD Wiki · GitHub . But this is HSA specific. The main thing to remember is you can either have an HSA configuration, if you have supported hardware (which you do), or you can run OpenCL.

6. Aside from Kaveri A10 7850 have the other CPUs been tested ? For instance on A10 7850 I get "The maximum queue size is 131072." What will I get on A6 7400K ? - The A10 7850K was the main development platform but the A6 7400K was tested and should work. The queue size will be the same.

View solution in original post

0 Likes
2 Replies
jtrudeau
Staff

I'm going to move this to the HSA forum, and will alert the engineers over there.

0 Likes
jedwards
Staff

Your statement "I've got the sample working on HSA and from what I understand in order to use OpenCL with the HSA I have to compile the CL code into BRIG/HSA" is incorrect. There is no runtime support for OpenCL on HSA meaning that you cannot take an OpenCL program using either the 1.2 or 2.0 host side APIs and have it interact with HSA or the HSA drivers, even if you port the OpenCL C program to HSAIL. There are tools, CLOC in particular, that allow you to translate device code (kernels) from OpenCL C to HSAIL, but those translated kernels/code can only be launched by the HSA runtime.

Answers to questions:

1. Where does the GPU driver fit in the picture [3] from both HSA and OpenCL point of view ? - The GPU driver is used to directly program the GPU device on the system, but for now the "HSA units" are only programmed by the KFD.

2. Does the amdkfd control both CPU and GPU ? Who for instance controls the device init and clocks ? Who builds the GPU command queue and sends commands to the GPU ? - The KFD only interacts with the GPU. The KFD controls initializing the kernel resources needed to support HSA processes and compute queues, but it shares GPU resources with the graphics driver. The KFD requests command queue resources from the graphics drivers, and exposes the command queue directly to the user (this is a user mode queue). The user sends commands directly to the GPU using the exposed user mode queue via AQL packets.

3. Can't I use OpenCL and HSA at the same time ? If so what is the proper/working configuration to do this ? - You cannot. Right now there isn't a unified driver and there isn't a publicly available version of OpenCL on HSA.

4. Is OpenCL 2.0 supported at the GPU level and if yes in what software configuration (driver, app sdk etc...) ? - I t is supported, but not on top of HSA. Please consult the OpenCL 2.0 installation page and do not use any of the distributed HSA drivers or software.

5. Is there a place that summarizes all of the configurations aside from wiki/forum/release notes ? There is a lot of information and configurations and you can easily mess things up. - From the HSA point of view you can look here: Home · HSAFoundation/HSA-Docs-AMD Wiki · GitHub . But this is HSA specific. The main thing to remember is you can either have an HSA configuration, if you have supported hardware (which you do), or you can run OpenCL.

6. Aside from Kaveri A10 7850 have the other CPUs been tested ? For instance on A10 7850 I get "The maximum queue size is 131072." What will I get on A6 7400K ? - The A10 7850K was the main development platform but the A6 7400K was tested and should work. The queue size will be the same.

0 Likes