AMD & NVIDIA Acceleration With GCC, LLVM Clang

Written by Michael Larabel in LLVM on 20 January 2016 at 08:34 AM EST. 4 Comments
With yesterday's merging of AMD HSA support into GCC 6, questions have been raised by readers in taking advantage of this acceleration support for AMD APUs and related items.

Obviously, the first question raised is how to make use of this support. Besides needing a Kaveri APU or better and some supported OpenMP code-bases, you must not only build GCC 6 but also other components. You need to compile GCC 6 with HSA support, enable the AMDKFD driver on your latest kernel, and configure the HSA runtime. If you are wanting to experiment with the GCC 6 SVN/Git code, instructions are available from the HSA Foundation GitHub but they haven't been updated in some months and were written prior to this GCC HSA support being mainlined. I'll likely try out the AMD HSA support myself around the time of the GCC 6 release in March when hopefully everything is all squared away.

A question was raised yesterday in the forums about AMD HSA support for LLVM/Clang. There isn't any mainline support on that front but there is this LLVM Git repository by the HSA Foundation. Sadly that work for providing HSA IL support for LLVM hasn't been updated since last July. I'm not aware of any other HSA LLVM effort ongoing at the moment.

On the topic of accelerators for compilers, if you aren't an AMD APU user but a NVIDIA Linux user, there is this guide on OpenMP 4.0 support on NVIDIA GPUs with LLVM Clang. If you are looking at things in the GCC space, there is the NVIDIA OpenACC offloading that premiered with GCC 5 but everything should be better in GCC 6.

In 2016 it should be interesting with these various open-source compiler offloading/accelerator support getting mainlined in GCC and LLVM/Clang that it should make for some interesting benchmark targets in the months ahead.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week