LibXPUInfo coalesces multiple APIs to provide multi-vendor, cross-platform device information in support of optimized device-selection by applications.
Click here for LibXPUInfo license.
- Supported:
- Windows 10+ (Primary target)
- Not currently supported:
- MacOS X 12+ x64/arm64. (CPU, System, and Metal GPUs only, no explicit NPU information)
- Linux, tested on Ubuntu 20.04. (Limited system and CPU info)
-
Prerequisites:
- LibXPUInfo targets C++14 or greater build environments.
- Install CMake with it in your path.
- Using the Visual Studio Installer, if not already present, add component "C++ x64/x86 Spectre-mitigated libs" for the version of the compiler you are using (i.e. "MSVC v143 - VS 2022")
- Or, remove lines from external/level-zero/CmakeLists.txt that add /Qspectre. Try external\l0_removeSpectre.bat to perform this patch.
-
If you want to accept the licenses of all git submodule dependencies, clone this repository with --recurse-submodules to get dependencies which will be placed in folder external/. Otherwise, modify .gitmodules to remove unwanted dependencies, and remove the corresponding LIBXPUINFO_USE_* preprocessor definitions.
- Git submodules
- Intel Graphics Control Library (IGCL) - License
- Level Zero Loader - License
- See above note regarding Spectre-mitigated libs
- OpenCL-CLHPP - License
- OpenCL-Headers - License
- OpenCL-ICD-Loader - License
- RapidJSON - License
- If not using RapidJSON, remove XPUINFO_USE_RAPIDJSON from LibXPUInfo project and all projects using LibXPUInfo.
- Git submodules
-
Windows
- If you want to use nVidia NVML and accept NVML license, run external\getNVMLDep.bat
- If you do not want to use NVML, remove XPUINFO_USE_NVML from preprocessor arguments for LibXPUInfo.vcxproj
- If you want to use OpenCL and accept related Apache-2.0 licenses, run external/buildExternalDeps_OCL.bat
- If you want to use Level Zero and accept related MIT license, run external/buildExternalDeps_L0.bat
- See above note regarding Spectre-mitigated libs
- Open LibXPUInfo.sln and build
- Note: Modify XPUINFO_USE_* preprocessor flags as desired
- Note: If you pull changes that update the Level Zero or OpenCL submodules, run the correspondig buildExternalDeps_*.bat again before building LibXPUInfo.
- If you want to use nVidia NVML and accept NVML license, run external\getNVMLDep.bat
-
MacOS/Linux - Not currently supported. No build config files provided. Use at your own risk - information provided may be incorrect.