Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce OpenCL exceptions #18495

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

jenshannoschwalm
Copy link
Collaborator

While installing an OpenCL device we do a number of checks for special situations, that could be detecting problematic drivers/devices or some implementations with advantage.

These checks leave a bitflag in device exceptions, they can later be tested while running OpenCL code via gboolean dt_opencl_exception(const int devid, const uint32_t mask);

An example is provided in demosaicer module, we know that the default AMD windows driver is bad for PPG so we do a fallback there.

Likely fixes #18042 #18284


Unfortunately we simply can't fix all OpenCL problems, it has been very difficult to test/debug blindly and most users are not able to compile & debug the kernels themselves.
This framework at least gives a fair chance to fix some issues in an easy way.

While installing an OpenCL device we do a number of checks for special situations, that could be detecting
problematic drivers/devices or some implementations with advantage.

These checks leave a bitflag in device exceptions, they can later be tested while running OpenCL code
via `gboolean dt_opencl_exception(const int devid, const uint32_t mask);`

An example is provided in demosaicer module, we know that the default AMD windows driver is bad for PPG
so we do a fallback there.
@jenshannoschwalm jenshannoschwalm added bugfix pull request fixing a bug feature: new new features to add scope: codebase making darktable source code easier to manage OpenCL Related to darktable OpenCL code scope: debugging labels Mar 1, 2025
@jenshannoschwalm jenshannoschwalm added this to the 5.2 milestone Mar 1, 2025
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@TurboGit TurboGit merged commit fb8a96d into darktable-org:master Mar 2, 2025
6 checks passed
@jenshannoschwalm jenshannoschwalm deleted the opencl_exceptions branch March 2, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix pull request fixing a bug feature: new new features to add OpenCL Related to darktable OpenCL code scope: codebase making darktable source code easier to manage scope: debugging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Colour cast if PPG demosaicing is used with OpenCL acceleration
2 participants