Skip to content

Example - Use case: Fixing broken OpenCL kernel compilation in legacy applications #467

@pauweh

Description

@pauweh

Example - Use case: Fixing broken OpenCL kernel compilation in legacy applications

Summary

The OpenCL Intercept Layer's AppendBuildOptions control was used to successfully
fix a real-world production problem: Older CaptureOne 20's GPU acceleration broken by
a stricter OpenCL C compiler in modern Nvidia drivers.

Use Case Description

CaptureOne 20 (photo editing software by Phase One) contains an OpenCL kernel
(ResamplePreFilter) with an address space pointer bug that was silently accepted
by older Nvidia drivers but rejected by newer ones (CUDA 13.0 / driver 581.xx+).

The fix: injecting -cl-std=CL1.2 via AppendBuildOptions forces the Nvidia compiler
to use OpenCL C 1.2 rules, allowing the kernel to compile successfully.

Setup that worked

  1. Local install: copy OpenCL.dll into the application's program folder

  2. Registry key in HKCU (no admin rights required):
    AppendBuildOptions = -cl-std=CL1.2
    Inject compiler flag via Windows registry: Create a file called for ex.
    CLIntercept.reg with this content and double-click it after saving:

    Windows Registry Editor Version 5.00
    [HKEY_CURRENT_USER\SOFTWARE\INTEL\IGFX\CLIntercept]
    "AppendBuildOptions"="-cl-std=CL1.2"
    "LogToFile"=dword:00000001

No administrator rights required - this writes to HKEY_CURRENT_USER only.

  1. Launch application from its taskbar shortcut.
    It is important that at startup time of C1
    working directory = program folder

Issues encountered during setup - suggestions for documentation improvement

1. cliloader loading at C1 launchtime

CaptureOne loads the OpenCL.DLL as usual in Windows from its startup folder when it exists there.
MIND IMPORTANT: At launchtime the working directory must be the
CaptureOne program folder with the added injection OpenCL.DLL.
Start from taskbar shortcut by default ensures this.
Or change to programs folder to start C1 from cmd-line for this to work.
Otherwise C1 will not use the cliloader injection. Switching to local install folder solved this.

Suggestion: Add a prominent warning at the top of cliloader.md:
"If your application loads OpenCL dynamically (LoadLibrary), cliloader will not
work. Use local install or global install instead."

Suggestion: Add this note to the local install documentation.

2. Working directory matters for local install on Windows

The local install only works if the application's working directory is its own
program folder. Applications launched from taskbar shortcuts typically have their
working directory set to the program folder, but applications launched from a
command prompt inherit the cmd window's working directory.

3. CLI_options.txt naming is confusing

The name implies command-line options but CLI stands for CLIntercept.
New users will spend time looking for command-line equivalents.

Suggestion: Clarify in documentation that CLI_ is the CLIntercept prefix,
not an abbreviation for Command Line Interface.

4. AppendBuildOptions is the right control for this use case

Not InjectProgramOptions or InjectProgramSource. The controls list is long
and finding the right one takes time.

Suggestion: Add a section to the docs: "Common use cases and which controls to use"
For example:

  • Force older OpenCL C standard: AppendBuildOptions=-cl-std=CL1.2
  • Debug kernel compilation errors: DumpProgramSource=1, BuildLogging=1

Result

C1 compiled successfully for all OpenCL kernels after injecting -cl-std=CL1.2.
GPU acceleration fully restored in CaptureOne 20 with Nvidia driver 581.57.

The intercept layer only needed to be active for a single run - once the
compiled kernel cache (ICOCL.bin) was saved by the application, it loads
the cached binary directly on all subsequent starts without the intercept layer.

Thank you

The OpenCL Intercept Layer is an incredibly powerful tool. This use case shows
its value beyond pure debugging - it can fix real compatibility problems in
closed-source applications without any application or driver modifications.

I'm sharing this here so other users can find this specific use case via search.
No action required from the maintainers unless you want to add some hints to the docs.

Written by and tested successfully with help from Claude.AI on 2026-04-11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions