{"id":13734405,"url":"https://github.com/KhronosGroup/OpenCL-ICD-Loader","last_synced_at":"2025-05-08T10:31:34.680Z","repository":{"id":38984395,"uuid":"45402911","full_name":"KhronosGroup/OpenCL-ICD-Loader","owner":"KhronosGroup","description":"The OpenCL ICD Loader project.","archived":false,"fork":false,"pushed_at":"2025-04-25T14:39:22.000Z","size":347,"stargazers_count":262,"open_issues_count":51,"forks_count":150,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-05-07T10:17:25.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KhronosGroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-02T15:25:32.000Z","updated_at":"2025-05-01T04:16:52.000Z","dependencies_parsed_at":"2023-02-18T00:01:20.839Z","dependency_job_id":"c8a607f3-fd02-4b9a-aa64-b401d9ecbea9","html_url":"https://github.com/KhronosGroup/OpenCL-ICD-Loader","commit_stats":{"total_commits":125,"total_committers":40,"mean_commits":3.125,"dds":0.696,"last_synced_commit":"ee329edc23258a53f9b5799446f7417d853ee143"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-ICD-Loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-ICD-Loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-ICD-Loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-ICD-Loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhronosGroup","download_url":"https://codeload.github.com/KhronosGroup/OpenCL-ICD-Loader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856568,"owners_count":21814858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:00:55.396Z","updated_at":"2025-05-08T10:31:34.640Z","avatar_url":"https://github.com/KhronosGroup.png","language":"C","readme":"# OpenCL\u003csup\u003eTM\u003c/sup\u003e ICD Loader\n\nThis repo contains the source code and tests for the Khronos official OpenCL ICD Loader.\n\n## CI Build Status\n\n[![Windows Build Status](https://github.com/KhronosGroup/OpenCL-ICD-Loader/workflows/Windows/badge.svg)](https://github.com/KhronosGroup/OpenCL-ICD-Loader/actions?query=workflow%3AWindows)\n[![Linux Build Status](https://github.com/KhronosGroup/OpenCL-ICD-Loader/workflows/Linux/badge.svg)](https://github.com/KhronosGroup/OpenCL-ICD-Loader/actions?query=workflow%3ALinux)\n[![MacOS Build Status](https://github.com/KhronosGroup/OpenCL-ICD-Loader/workflows/MacOS/badge.svg)](https://github.com/KhronosGroup/OpenCL-ICD-Loader/actions?query=workflow%3AMacOS)\n\n## Introduction\n\nOpenCL defines an *Installable Client Driver* (ICD) mechanism to allow developers to build applications against an *Installable Client Driver* loader (ICD loader) rather than linking their applications against a specific OpenCL implementation.\nThe ICD Loader is responsible for:\n\n* Exporting OpenCL API entry points\n* Enumerating OpenCL implementations\n* Forwarding OpenCL API calls to the correct implementation\n\nThis repo contains the source code and tests for the Khronos official OpenCL ICD Loader.\n\nNote that this repo does not contain an OpenCL implementation (ICD).\nYou will need to obtain and install an OpenCL implementation for your OpenCL device that supports the OpenCL ICD extension `cl_khr_icd` to run an application using the OpenCL ICD Loader.\n\nThe OpenCL *Installable Client Driver* extension (`cl_khr_icd`) is described in the OpenCL extensions specification, which may be found on the [Khronos OpenCL Registry](https://www.khronos.org/registry/OpenCL/).\n\n## Build Instructions\n\n\u003e While the ICD Loader can be built and installed in isolation, it is part of the [OpenCL SDK](https://github.com/KhronosGroup/OpenCL-SDK). If looking for streamlined build experience and a complete development package, refer to the SDK build instructions instead of the following guide.\n\n### Dependencies\n\nThe OpenCL ICD Loader requires:\n- the [OpenCL Headers](https://github.com/KhronosGroup/OpenCL-Headers/).\n  - It is recommended to install the headers via CMake, however a convenience shorthand is provided. Providing `OPENCL_ICD_LOADER_HEADERS_DIR` to CMake, one may specify the location of OpenCL Headers. By default, the OpenCL ICD Loader will look for OpenCL Headers in the inc directory.\n- The OpenCL ICD Loader uses CMake for its build system.\nIf CMake is not provided by your build system or OS package manager, please consult the [CMake website](https://cmake.org).\n\n### Example Build\n\nFor most Windows and Linux usages, the following steps are sufficient to build the OpenCL ICD Loader:\n\n1. Clone this repo and the OpenCL Headers:\n\n        git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader\n        git clone https://github.com/KhronosGroup/OpenCL-Headers\n\n1. Install OpenCL Headers CMake package\n\n        cmake -D CMAKE_INSTALL_PREFIX=./OpenCL-Headers/install -S ./OpenCL-Headers -B ./OpenCL-Headers/build \n        cmake --build ./OpenCL-Headers/build --target install\n\n1. Build and install OpenCL ICD Loader CMake package. _(Note that `CMAKE_PREFIX_PATH` need to be an absolute path. Update as needed.)_\n\n        cmake -D CMAKE_PREFIX_PATH=/absolute/path/to/OpenCL-Headers/install -D CMAKE_INSTALL_PREFIX=./OpenCL-ICD-Loader/install -S ./OpenCL-ICD-Loader -B ./OpenCL-ICD-Loader/build \n        cmake --build ./OpenCL-ICD-Loader/build --target install\n\nNotes:\n\n* For x64 Windows builds, you need to instruct the default Visual Studio generator by adding `-A x64` to all your command-lines.\n\n* Some users may prefer to use a CMake GUI frontend, such as `cmake-gui` or `ccmake`, vs. the command-line CMake.\n\n### Example Use\n\nExample CMake invocation\n\n```bash\ncmake -D CMAKE_PREFIX_PATH=\"/chosen/install/prefix/of/headers;/chosen/install/prefix/of/loader\" /path/to/opencl/app\n```\n\nand sample `CMakeLists.txt`\n\n```cmake\ncmake_minimum_required(VERSION 3.0)\ncmake_policy(VERSION 3.0...3.18.4)\nproject(proj)\nadd_executable(app main.cpp)\nfind_package(OpenCLHeaders REQUIRED)\nfind_package(OpenCLICDLoader REQUIRED)\ntarget_link_libraries(app PRIVATE OpenCL::Headers OpenCL::OpenCL)\n```\n\n## OpenCL ICD Loader Tests\n\nOpenCL ICD Loader Tests can be run using `ctest` from the `build` directory. CTest which is a companion to CMake. The OpenCL ICD Loader Tests can also be run directly by executing `icd_loader_test[.exe]` executable from the bin folder.\n\n_(Note that running the tests manually requires setting up it's env manually, by setting `OCL_ICD_FILENAMES` to the full path of `libOpenCLDriverStub.so`/`OpenCLDriverStub.dll`, something otherwise done by CTest.)_\n\n## Registering ICDs\n\nThe method to installing an ICD is operating system dependent.\n\n### Registering an ICD on Linux\n\nInstall your ICD by creating a file with the full path to the library of your implementation in `/etc/OpenCL/vendors` for eg.:\n\n    echo full/path/to/libOpenCLDriverStub.so \u003e /etc/OpenCL/vendors/test.icd\n\n### Registering an ICD on Windows\n\nInstall your ICD by adding a `REG_DWORD` value to the registry keys:\n\n    // For 32-bit operating systems, or 64-bit tests on a 64-bit operating system:\n    HKEY_LOCAL_MACHINE\\SOFTWARE\\Khronos\\OpenCL\\Vendors\n    \n    // For 32-bit tests on a 64-bit operating system:\n    HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Khronos\\OpenCL\\Vendors\n\n    // The name of the REG_DWORD value should be the full path to the library of your implementation, for eg.\n    // OpenCLDriverStub.dll, and the data for this value should be 0.\n\n## About Layers\n\nLayers have been added as an experimental feature in the OpenCL ICD Loader. We do not\nexpect the API or ABI to change significantly, but the OpenCL Working Group reserves\nthe right to do so. The layer support can also be completely deactivated during\nconfiguration by using the `ENABLE_OPENCL_LAYERS` (`ON` by default) cmake variable:\n\n```bash\ncmake -DENABLE_OPENCL_LAYERS=OFF\n```\n\nFor now, runtime configuration of layers is done using the `OPENCL_LAYERS` environment\nvariable. A colon (Linux) or semicolon (Windows) list of layers to use can be provided\nthrough this environment variable.\n\nWe are looking for feedback.\n\n## Support\n\nPlease create a GitHub issue to report an issue or ask questions.\n\n## Contributing\n\nContributions to the OpenCL ICD Loader are welcomed and encouraged.\nYou will be prompted with a one-time \"click-through\" CLA dialog as part of submitting your pull request or other contribution to GitHub.\n\n## Table of Debug Environment Variables\n\nThe following debug environment variables are available for use with the OpenCL ICD loader:\n\n| Environment Variable              | Behavior            |  Example Format      |\n|:---------------------------------:|---------------------|----------------------|\n| OCL_ICD_FILENAMES                 | Specifies a list of additional ICDs to load.  The ICDs will be enumerated first, before any ICDs discovered via default mechanisms. | `export OCL_ICD_FILENAMES=libVendorA.so:libVendorB.so`\u003cbr/\u003e\u003cbr/\u003e`set OCL_ICD_FILENAMES=vendor_a.dll;vendor_b.dll` |\n| OCL_ICD_VENDORS                   | On Linux and Android, specifies a directory to scan for ICDs to enumerate in place of the default `/etc/OpenCL/vendors'. |  `export OCL_ICD_VENDORS=/my/local/icd/search/path` |\n| OPENCL_LAYERS                     | Specifies a list of layers to load. |  `export OPENCL_LAYERS=libLayerA.so:libLayerB.so`\u003cbr/\u003e\u003cbr/\u003e`set OPENCL_LAYERS=libLayerA.dll;libLayerB.dll` |\n| OPENCL_LAYER_PATH                 | On Linux and Android, specifies a directory to scan for layers to enumerate in place of the default `/etc/OpenCL/layers'. | `export OPENCL_LAYER_PATH=/my/local/layers/search/path` |\n| OCL_ICD_ENABLE_TRACE              | Enable the trace mechanism          |  `export OCL_ICD_ENABLE_TRACE=True`\u003cbr/\u003e\u003cbr/\u003e`set OCL_ICD_ENABLE_TRACE=True`\u003cbr/\u003e`true, T, 1 can also be used here.`  |\n","funding_links":[],"categories":["OpenCL Tools, Libraries and Frameworks","CUDA Tools Libraries, and Frameworks"],"sub_categories":["viii. Linear Regression"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKhronosGroup%2FOpenCL-ICD-Loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKhronosGroup%2FOpenCL-ICD-Loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKhronosGroup%2FOpenCL-ICD-Loader/lists"}