OpenCL Issues

This page explains common OpenCL error codes (CL_INVALID_BINARY, CL_PLATFORM_NOT_FOUND_KHR, CL_OUT_OF_RESOURCES, and others) and how to fix them.

Error

Explanation

Instructions

CL_INVALID_BINARY

This indicates a problem with your OpenCL device (CPU/GPU) or driver.

  1. Install any pending operating system updates.

  2. Update your GPU drivers to the latest available version.

  3. Verify that your driver supports OpenCL 1.2.

  4. Check the GPU 要件.

CL_INVALID_QUEUE_PROPERTIES

CL_PLATFORM_NOT_FOUND_KHR

Your system is missing OpenCL drivers.

CL_OUT_OF_RESOURCES

This indicates a problem with your OpenCL device (CPU/GPU) or driver.

  1. Verify that there are no other programs running that consume memory from this OpenCL device (CPU/GPU).

  2. See Memory Leak in .NET to make sure that you dispose of all objects in your script.

  3. Verify that your driver supports OpenCL 1.2.

  4. Check the GPU 要件.

  5. If necessary, upgrade your OpenCL device to a model with more resources.

  6. Ubuntu 20.04 only: Linux 5.8 kernel with Intel GPU as rendering device can give openCL errors. Downgrade to the LTS(stable) base Linux kernel 5.4 to fix it.

CL_MEM_OBJECT_ALLOCATION_FAILURE

CL_OUT_OF_HOST_MEMORY

Your computer does not have enough memory to execute the current task.

  1. Verify that there are no other programs running that consume memory from this OpenCL device (CPU/GPU).

  2. Check the GPU 要件.

  3. If necessary, upgrade your computer's memory.

CL_INVALID_BINARY

To check if your OpenCL driver is above the required version, you can use clinfo.

Windows
  1. Download the clinfo Windows binary file.

  2. Launch the Command Prompt by pressing Win + R keys on the keyboard, then type cmd and press Enter.

  3. Navigate to the directory that contains the downloaded file (clinfo.exe) and execute the following command:

    clinfo.exe -l
    

    This will print all available information about all OpenCL platforms on the system and the devices they expose.

    ../../_images/cmd_cl_windows.png

    If your GPU is not listed you may need to install the OpenCL drivers and/or graphics drivers.

  4. To check the OpenCL driver version, use clinfo and search for the OpenCL platform version:

    clinfo.exe | findstr "Platform\ Version"
    

    If the version is below OpenCL 1.2, you need to update your graphics drivers.

Ubuntu
  1. Open a terminal window by pressing Ctrl + Alt + T keys on the keyboard and install clinfo.

    sudo apt install -y clinfo
    
  2. Run clinfo -l to list all OpenCL platforms.

    sudo /usr/bin/clinfo -l
    

    This will print all available information about all OpenCL platforms on the system and the devices they expose.

    If your GPU is not listed you may need to install the OpenCL drivers and/or graphics drivers.

    ../../_images/no-platforms-ubuntu.png
  3. To check the OpenCL driver version, use clinfo and search for the OpenCL platform version:

    sudo /usr/bin/clinfo | grep "Platform Version"
    

    If the version is below OpenCL 1.2, you need to update your OpenCL drivers and/or graphics drivers.

CL_PLATFORM_NOT_FOUND_KHR

On Ubuntu, you may need to add your user as part of the render and/or video groups for OpenCL to work.

Ubuntu 26.04

OpenCL will not work if your user is not part of the render group and the video group.

Open a terminal window by pressing Ctrl + Alt + T keys on the keyboard, then add your user to the correct group:

sudo gpasswd -a $USER render
sudo gpasswd -a $USER video
Ubuntu 24.04

OpenCL will not work if your user is not part of the render group and the video group.

Open a terminal window by pressing Ctrl + Alt + T keys on the keyboard, then add your user to the correct group:

sudo gpasswd -a $USER render
sudo gpasswd -a $USER video
Ubuntu 22.04

OpenCL will not work if your user is not part of the render group and the video group.

Open a terminal window by pressing Ctrl + Alt + T keys on the keyboard, then add your user to the correct group:

sudo gpasswd -a $USER render
sudo gpasswd -a $USER video
Ubuntu 20.04

OpenCL will not work if your user is not part of the render group.

Open a terminal window by pressing Ctrl + Alt + T keys on the keyboard, then add your user to the correct group:

sudo gpasswd -a $USER render
Ubuntu 18.04

注釈

Support for Ubuntu 18.04 was removed in SDK 2.10. To view its setup instructions, switch the Knowledge Base to a previous version in the top left corner; they are also preserved in Knowledge Base versions for SDK 2.9 and earlier.

Restart your PC:

sudo reboot