Skip to content

Comments

Static fixes#270

Merged
bashbaug merged 2 commits intoKhronosGroup:mainfrom
Kerilk:static-fixes
Feb 6, 2026
Merged

Static fixes#270
bashbaug merged 2 commits intoKhronosGroup:mainfrom
Kerilk:static-fixes

Conversation

@Kerilk
Copy link
Contributor

@Kerilk Kerilk commented Feb 3, 2026

This addresses issue #269, as well as disable loader managed dispatch for static build, as it is fundamentally broken if several instance of the loader end up setting object dispatch data. To re-enable this we would need to get instance platform support (see here for prototype https://github.com/Kerilk/OpenCL-ICD-Loader/tree/cl_khr_icd-instance).

Note that we would need to expose a loader extension to allow deinitialization to be done explicitly on Windows in the static case, but this will need to be discussed. For now, the statically linked loader will be leaking memory on windows.

Unless @jenatali has a better suggestion.

@Kerilk Kerilk requested a review from bashbaug February 3, 2026 16:22
Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

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

LGTM.

We should probably add a couple of CI configs that build the static library if folks are shipping software using this path (#269 mentions FFmpeg).

@jenatali
Copy link
Contributor

jenatali commented Feb 3, 2026

My suggestion would be to disallow static loader configurations on Windows. As we've discussed (at length), the OS is the piece that should decide how driver discovery works, and needs to be able to continue evolving and changing. Apps that get frozen in time that include driver discovery will be broken eventually. The CL ICD loader should not be facilitating this inevitable scenario.

@Kerilk
Copy link
Contributor Author

Kerilk commented Feb 3, 2026

My suggestion would be to disallow static loader configurations on Windows. As we've discussed (at length), the OS is the piece that should decide how driver discovery works, and needs to be able to continue evolving and changing. Apps that get frozen in time that include driver discovery will be broken eventually. The CL ICD loader should not be facilitating this inevitable scenario.

If I had it my way I would disallow static builds for all platform that support shared libraries. In practice, people will just hack around the restriction, so this tries to avoid some potential pitfalls around static library usage of the loader.

@Kerilk Kerilk force-pushed the static-fixes branch 3 times, most recently from 0d00280 to 86d9a37 Compare February 6, 2026 17:31
@bashbaug bashbaug merged commit 71ea2a6 into KhronosGroup:main Feb 6, 2026
103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants