Showing results for 
Search instead for 
Did you mean: 


Adept III

Mesa OpenCL with RX Vega support for OpenSUSE Tumbleweed

Some days ago, I successfully ran the Mesa-OpenCL on my OpenSUSE Tumbleweed. Because, an OpenSUSE Tumbleweed still doesn't provide new LLVM 6.0 needed to support RX VEGA on Mesa-OpenCL, I wrote small tutorial to do it (these tutorial can be used on other Linux distros with missing LLVM 6.0).

Before all, you need in your the Linux installation:

* linux kernel 4.15 or later with AMDGPU drivers

* GCC, G++ compilers - to compile sources

* CMake - tool generate Makefiles

* GNU make

* Autoconf, Automake, libtool

* devel packages (includes) for libdrm

* Python (for libclc configure script)

* OpenCL ICD - OpenCL Installable Client Driver

* git - git source control system

In this tutorial we install our Mesa-OpenCL to non-system directory (for safety) like '/opt/newgallium'. You should prepare sources before this procedure:

* LLVM 6.0.0 - can be downloaded from

* CLANG 6.0.0 - can be downloaded from

* libclc (svn revision r319017 or later) - repository

* Mesa (18.0.0-rc1 or later) - can be downloaded from

Small note: before all preparation check umask (should 022 to set correct permissions for buildings and installation).

Typical procedure to prepare sources:


tar Jxvf llvm-6.0.0.src.tar.xz

cd llvm-6.0.0.src

cd tools

tar Jxvf cfe-6.0.0.src.tar.xz

mv cfe-6.0.0.src clang

cd ../../ # top source directory

# libclc

svn checkout libclc

# Mesa

tar Jxvf mesa-18.0.0-rc4.tar.xz

Now, we configure and build LLVM 6.0.0:

cd llvm-6.0.0.src

mkdir build

cd build


make -j4

Now, we can install LLVM 6.0 '/opt/newgallium' by using command (should be run as root):

make install

Now we should set LD_LIBRARY_PATH to LLVM 6.0.0 binaries:

export LD_LIBRARY_PATH=/opt/newgallium/lib64

Next step is building a libclc library:

cd libclc

./configure --prefix=/opt/newgallium --with-llvm-config=/opt/newgallium/bin/llvm-config


And libclc installation (should be run as root):

make install

Next step is Mesa3D building:

cd mesa-18.0.0-rc4

NOCONFIGURE=1 ./  # run autogen without configuring

mkdir build

cd build

export PKG_CONFIG_PATH=/opt/newgallium/lib64/pkgconfig:/opt/newgallium/share/pkgconfig

../configure --prefix=/opt/newgallium --enable-opencl --enable-opencl-icd --enable-gbm --with-llvm-prefix=/opt/newgallium \

      --with-platforms=drm,x11 --with-dri-drivers=swrast,radeon \

      --with-gallium-drivers=svga,r600,radeonsi --enable-glx-tls

make -j4

And finally Mesa3D installation (as root):

make install

After all building and installation you should add to '/etc/OpenCL/vendors' directory your ICD (run as root):

echo /opt/newgallium/lib64/ > /etc/OpenCL/vendors/newgallium.icd

Sometimes, you need to set LD_LIBRARY_PATH to installation before testing a Mesa-OpenCL

export LD_LIBRARY_PATH=/opt/newgallium/lib64

Now, you can try installation by running command clinfo or other an OpenCL program.

0 Replies