maweigert / spimagine

GPU accelerated volume rendering / processing in Python
BSD 3-Clause "New" or "Revised" License
117 stars 17 forks source link

GPU+OpenCL+Intel+Linux with Beignet #2

Closed paulmueller closed 9 years ago

paulmueller commented 9 years ago

This issue is for self-reference and might be useful for anyone running into the problem of needing to run spimagine or any other OpenCL application on an Intel-based GPU on Linux.

Intel does not provide OpenCL libraries for (some of?) its GPU on Linux. However, there is Beignet:

The installation is described in the Readme. With a Haswell chip (Thinkpad X1 Carbon):

lspci -nnk | grep "VGA\|'Kern'\|3D\|Display" -A2 
00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a16] (rev 0b)
    Subsystem: Lenovo Device [17aa:2218]
    Kernel driver in use: i915

A couple of tests failed. According to the "KnownIssues", I only needed to add the line

export OCL_IGNORE_SELF_TEST=1

to my .bashrc to make spimagine run on my GPU. This is the current ouput:

Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (3, 7, 5)
See README.md or http://www.freedesktop.org/wiki/Software/Beignet/
Beignet: Warning - overriding self-test failure
Beignet: Warning - overriding self-test failure
INFO:PyOCL.OCLProcessor | using device: Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile
could not import libtiff
could not import imgtools
Beignet: Warning - overriding self-test failure
Beignet: Warning - overriding self-test failure
INFO:PyOCL.OCLProcessor | using device: Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile
/usr/lib/python2.7/dist-packages/pyopencl/__init__.py:61: CompilerWarning: Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.
  "to see more.", CompilerWarning)

The framerate is OK.