GPU-accelerated image processing in ImageJ using CLIJ

View the Project on GitHub clij/clij-docs


Big Images on NVidia cards

Errors may pop up when processing big images on NVidia cards on Windows (CL_INVALID_COMMAND_QUEUE, CL_INVALID_PROGRAM_EXECUTABLE, CL_MEM_OBJECT_ALLOCATION_FAILURE): The issue is related to a timeout of the operating system interrupting processing on the GPU. Add these keys to the windows registry and restart the machine (warning, don’t do this if you’re not sure. Ask you IT department for support. Read the BSD3 license file for details on what why we’re not responsible for your actions on your computer ):


Here is more information about what TDR is:

Initialisation fails

Fiji crashes when calling the first CLIJ filter: Check if the initialisation contains a proper name for a GPU.

Repeated initialisation fails on AMD Vega 10

When creating CLIJ instances and closing them repeatedly, it crashes after about 40 attempts. This test allows reproducing the issue on specified hardward. Workaround: Don’t close the CLIJ instance and keep working with the singleton instance.

Result image is black or shows random textures

This might happend with older GPUs which have not been tested. A helpful workaround is converting all images to 32 bit using run("32-bit"); before sending them to the GPU. not found

“ Cannot find source: [Object] <path/>” exception: Navigate to the jars subdirectory of your Fiji installation and locate clearcl.jar files, e.g. by typing dir clearcl* or ls clearcl*. If there are several versions installed, remove the older one. In order to fix this exception, you need at least clearcl-0.5.5-RH.jar.

Problem while setting argument

“clearcl.exceptions.ClearCLException: problem while setting argument ‘parameter_of_type_float’”: To hand over parameters of type float, you need to explicitly type it. Use from java.lang import Float and Float(1.5) to handover a value of 1.5 to an OpenCL parameter of type float.

Class not found on Linux

CLIJ doesn’t start on Ubuntu linux with an error message that a class called ClearCLBackendJOCL cannot be initialized. Installing ‘ocl-icd-opencl-dev’ helped here.

Exceptions on Linux

CLIJ throws various exceptions, like CL_OUT_OF_HOST_MEMORY on Linux. Try installing an OpenCL-driver such as beignet. On Fedora 27 Linux, this command list helped:

sudo yum install ocl-icd-devel
sudo yum install cmake
sudo yum install llvm
sudo yum install llvm-devel
sudo yum install libdrm libdrm-devel
sudo yum install libXext-devel
sudo yum install libXfixes-devel
sudo yum install clang-devel

git clone
cd beignet/
mkdir build
cd build
cmake ../
sudo make install

More info can be found on the website of the beignet project.

Back to CLIJ documentation