site  contact  subhomenews

OpenGL hardware acceleration for AMD video card

December 31, 2017 — BarryK

I have posted that only had software rendering for OpenGL, for my AMD/ATI BART Radeon HD 6870 video card:

http://bkhome.org/news/201712/amdati-barts-xt-radeon-hd-6870-card.html

I compiled 'mesa' in OpenEmbedded without 'llvm'. I wanted to avoid llvm, due to it's size, as have done in some earlier pups. The problem is that some of the AMD/ATI mesa drivers require llvm.

The mesa drivers that require llvm are: r300, r600, radeonsi

However, I did read that r600 can be compiled without llvm, by the configure options:

--with-gallium-drivers=r600 --disable-gallium-llvm

Not so r300 and radeonsi, they need llvm, apparently.

I determined that my video card needs the 'r600' driver. I decided to include llvm, for the sake of others who might need the r300 and radeonsi drivers.

llvm can be compiled in OE, however, it is not configured properly, nor is mesa in OE configured properly -- for example, won't build the r600 driver.

So, I have built llvm and mesa in a running Quirky Pyro64 (0.6.2). The package 'elfutils' is required, can be installed from the PPM.

Here is how I compiled llvm, version 3.9.1 (with hints from LFS):

# mkdir build
# cd build
# CC=gcc
# CXX=g++
removed: -DLLVM_ENABLE_FFI=ON
# cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_LLVM_DYLIB=ON \
 -DLLVM_TARGETS_TO_BUILD="host;AMDGPU;X86" -Wno-dev ..
# make
# new2dir make install

Then mesa 17.0.2:

# ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=x86_64-pc-linux-gnu \
 --enable-shared-dricore --enable-osmesa --enable-xa --enable-gallium-llvm --enable-shared-glapi \
 --enable-glx-tls --enable-dri --with-dri-drivers=i915,i965,nouveau,r200,radeon,swrast \
 --with-gallium-drivers=r600,r300,radeonsi --enable-dri3 --enable-gles1 --enable-gles2 \
 --enable-egl --enable-llvm-shared-libs --disable-omx-bellagio --enable-vdpau \
 --with-egl-platforms='drm x11'
# make
# new2dir make install

There was some uncertainty here, what drivers to put into "--with-dri-drivers" and "--with-gallium-drivers". I did what seemed sensible, though it did seem that some, for example "i965", could be moved to the latter. Some online examples have the drivers in both, which seems odd.

Some of the options are auto-detected, however, putting them in explicitly is good to check that the host has the required packages.

Yay, running 'glxinfo':

OpenGL renderer string: Gallium 0.4 on AMD BARTS (DRM 2.50.0 / 4.14.1, LLVM 3.9.1)

...that is, not using the "software rasterizing" anymore. I haven't been able to give any TLC for NVIDIA video, will have to get hold of an NVIDIA card to play with.

Tags: easy, quirky