{"id":20725574,"url":"https://github.com/oneapi-src/level-zero","last_synced_at":"2026-01-16T04:50:05.830Z","repository":{"id":41194558,"uuid":"245246663","full_name":"oneapi-src/level-zero","owner":"oneapi-src","description":"oneAPI Level Zero Specification Headers and Loader","archived":false,"fork":false,"pushed_at":"2024-05-22T23:16:14.000Z","size":3261,"stargazers_count":182,"open_issues_count":65,"forks_count":73,"subscribers_count":34,"default_branch":"master","last_synced_at":"2024-05-22T23:31:50.278Z","etag":null,"topics":["oneapi"],"latest_commit_sha":null,"homepage":"https://spec.oneapi.com/versions/latest/elements/l0/source/index.html","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oneapi-src.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-05T19:10:14.000Z","updated_at":"2024-06-17T20:02:58.820Z","dependencies_parsed_at":"2023-12-20T08:02:28.876Z","dependency_job_id":"94fcceba-241f-4490-9f3a-bcfaffb5389c","html_url":"https://github.com/oneapi-src/level-zero","commit_stats":null,"previous_names":[],"tags_count":96,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneapi-src%2Flevel-zero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneapi-src%2Flevel-zero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneapi-src%2Flevel-zero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneapi-src%2Flevel-zero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oneapi-src","download_url":"https://codeload.github.com/oneapi-src/level-zero/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"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":["oneapi"],"created_at":"2024-11-17T04:19:24.017Z","updated_at":"2026-01-16T04:50:05.817Z","avatar_url":"https://github.com/oneapi-src.png","language":"C++","readme":"# oneAPI Level Zero\n\nThis repository contains the following components of oneAPI:\n\n- Copies of the Level Zero Specification API C/C++ header files\n- Level Zero Loader\n- Level Zero Validation Layer\n- Level Zero Tracing Layer\n\nThis project is part of the larger [oneAPI](https://www.oneapi.com/) project.\n\nSee the [oneAPI specification](https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/) for more information about the oneAPI project.\n\nSee the [Level Zero specification](https://oneapi-src.github.io/level-zero-spec/level-zero/latest/index.html) for more information about Level Zero.\n\nSee the [Level Zero specification repo](https://github.com/oneapi-src/level-zero-spec) for contributing to the specification.\n\nLevel Zero API versions are listed in the `ze_api_version_t` enumeration, located in the\n[ze_api.h](./include/ze_api.h) file.\n\n# Building and Installing\n\nProject is defined using [CMake](https://cmake.org/).\n\n## Linux\n\n```\nmkdir build\ncd build\ncmake .. -D CMAKE_BUILD_TYPE=Release\ncmake --build . --target package --parallel $(nproc)\ncmake --build . --target install\n```\n\n# Static Loader\nTo build the Loader statically one must set `-DBUILD_STATIC=1` during the cmake configuration step.\n\nThe build of the static loader creates a ze_loader.a/.lib which will link the source/lib source code into your application or library.\n\nThis enables for inclusion of all L0 symbols into your application/library allowing for backwards compatability with older versions of the Loader.\n\nThe static loader \"shim\" dynamically loads the ze_loader.so/.dll on the system enabling plugin like behavior where the init will fail gracefully given a usable loader or L0 driver is not found.\n\nWhen the `-DBUILD_STATIC=1` is executed, the dynamic loader and layers are not built to avoid conflicts during local test execution which requires the dynamic loader and layers to all be the same version for compatability.\n\nTesting with the static loader requires a build of the dynamic loader or an installation of the dynamic loader to exist in the library path.\n\n# Debug Trace\nThe Level Zero Loader has the ability to print warnings and errors which occur within the internals of the Level Zero Loader itself.\n\nTo enable this debug tracing feature, set the environment variable `ZE_ENABLE_LOADER_DEBUG_TRACE=1`.\n\nThis will enforce the Loader to print all errors whether fatal or non-fatal to stderr with the PREFIX `ZE_LOADER_DEBUG_TRACE:`.\n\n\n# Logging to File - PREVIEW\nThe Level Zero Loader uses spdlog logging and can be controlled via environment variables:\n\n`ZEL_ENABLE_LOADER_LOGGING=1`\n\n[DEPRECATED] `ZEL_LOADER_LOG_FILE=/path/to/logfile`\n\n`ZEL_LOADER_LOG_DIR='/directory/path'`\n\n`ZEL_LOADER_LOGGING_LEVEL=debug`\n\nValid logging levels are trace, debug, info, warn, error, critical, off.\nLogging is disabled by default but when enabled the default level is 'warn'.\nThe default log file is 'ze_loader.log' in '.oneapi_logs' in the current\nuser's home directory.\n\nThis feature is in early development and is preview only.\n\n# Logging API calls\nThe Level Zero Loader will log all API calls whenever logging level is set to `trace` and\nvalidation layer is enabled. Following variables need to be set to enable API logging:\n\n`ZEL_ENABLE_LOADER_LOGGING=1`\n\n`ZEL_LOADER_LOGGING_LEVEL=trace`\n\n`ZE_ENABLE_VALIDATION_LAYER=1`\n\nBy default logs will be written to the log file, as described above. To print the logs\nto stderr instead, `ZEL_LOADER_LOG_CONSOLE=1` needs to be set.\n\n# Driver/Device Sorting\n\nAs of v1.20.3 of the Loader, Drivers and Devices reported to the user are sorted to enable the first device to be the best available device.\n\n- By default, drivers will be sorted such that the ordering will be:\n    - Drivers with Discrete GPUs only\n    - Drivers with Discrete and Integrated GPUs\n    - Drivers with Integrated GPUs\n    - Drivers with Mixed Devices Types (ie GPU + NPU)\n    - Drivers with Non GPU Devices Only\n- If ZE_ENABLE_PCI_ID_DEVICE_ORDER is set, then the following ordering\n  is provided:\n    - Drivers with Integrated GPUs\n    - Drivers with Discrete and Integrated GPUs\n    - Drivers with Discrete GPUs only\n    - Drivers with Mixed Devices Types (ie GPU + NPU)\n    - Drivers with Non GPU Devices Only\n\nThe order of the sorting is based on the enumerator:\n`zel_driver_type_t`\n\nThe ordering of the drivers reported to the user is based on the order of the enumerations provided.\nWhen additional driver types are added, they should be added to the end of the list to avoid reporting new device types\nbefore known device types.\n\nNOTE: Due to known issues with Program Instrumentation usecases, when ZET_ENABLE_PROGRAM_INSTRUMENTATION is enabled, driver sorting is not possible in the loader.\n\n## Windows\nUse Microsoft* Visual Studio x64 command prompt to run the following commands and build the project:\n```sh\nmkdir build\ncd build\ncmake -G \"NMake Makefiles\" CMAKE_CXX_FLAGS=\"/EHsc\" ..\nnmake\n```\n\n\n# Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for more information.\n\n# License\n\nDistributed under the MIT license. See [LICENSE](LICENSE) for more information.\n\n# Security\n\nSee Intel's [Security Center](https://www.intel.com/content/www/us/en/security-center/default.html) for information on how to report a potential security issue or vulnerability.\n\nSee also [SECURITY](SECURITY.md).\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Others"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneapi-src%2Flevel-zero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foneapi-src%2Flevel-zero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneapi-src%2Flevel-zero/lists"}