{"id":13437350,"url":"https://github.com/ARM-software/libGPUInfo","last_synced_at":"2025-03-19T06:31:01.531Z","repository":{"id":171427745,"uuid":"612295299","full_name":"ARM-software/libGPUInfo","owner":"ARM-software","description":"A utility library for application developers to query the configuration of the Arm Immortalis GPU or Arm Mali GPU present in their system.","archived":false,"fork":false,"pushed_at":"2024-11-14T20:49:12.000Z","size":45,"stargazers_count":42,"open_issues_count":2,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-14T21:30:20.527Z","etag":null,"topics":["arm","vulkan"],"latest_commit_sha":null,"homepage":"","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/ARM-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"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":"2023-03-10T16:11:53.000Z","updated_at":"2024-11-14T20:40:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"e5dbfa0d-e0c2-40ca-b0f8-82624241e640","html_url":"https://github.com/ARM-software/libGPUInfo","commit_stats":null,"previous_names":["arm-software/libgpuinfo"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2FlibGPUInfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2FlibGPUInfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2FlibGPUInfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2FlibGPUInfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ARM-software","download_url":"https://codeload.github.com/ARM-software/libGPUInfo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244370964,"owners_count":20442319,"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":["arm","vulkan"],"created_at":"2024-07-31T03:00:56.217Z","updated_at":"2025-03-19T06:31:01.518Z","avatar_url":"https://github.com/ARM-software.png","language":"C++","readme":"# About\n\nlibGPUInfo is a small utility library that allows applications to query the\nconfiguration of the Arm® Immortalis™ or Arm Mali™ GPU present in the system.\nThis information allows developers to adjust application workload complexity to\nmatch the performance capability of the current device.\n\nThis library is able to provide the Arm GPU hardware configuration, as well as\nperformance metrics for the shader cores inside the GPU. The library is unable\nto provide system information, such as the available GPU clock frequencies,\nbecause this is provided by the device manufacturer and is not part of the Arm\nGPU itself.\n\nFor offline documentation about the capabilities of the various Arm GPUs on the\nmarket today please refer to the [Arm GPU Datasheet][2].\n\n## Supported devices\n\nThis library aims to support all Arm GPU products from the Mali-T700 series\nonwards, ensuring developers have coverage of the vast majority of smartphones\nwith Arm GPUs that are in use today. If you find a device with an Arm GPU which\ndoes not work, or gives inaccurate results, please open an Issue on the GitHub\nissue tracker.\n\nThis library only supports devices using the Arm commercial driver.\n\n## Recent changes\n\n* Change log: [1.x series](./docs/changelog.md)\n\n## Related API extensions\n\nThis library is intended to support any Arm device, but some developers prefer\nto use functionality within the graphics API when it is available. New devices\ncan report a similar set of information to this library using in-API queries.\n\nWe recommend using the extensions on devices where it is available. Doing so\nmeans the application automatically gets up-to-date information for all\ndevices, even those released after the application binary was built.\n\nFor more information please refer to the extension specifications:\n\n* [VK_ARM_shader_core_properties][3]\n* [VK_ARM_shader_core_builtins][4]\n\n\n## License\n\nThis project is licensed under the MIT license. By downloading any component\nfrom this repository you acknowledge that you accept terms specified in the\n[LICENSE.txt](LICENSE.txt) file.\n\n# Available information\n\nThe query mechanism can report the following information about the GPU:\n\n* **Name:** The product name string, e.g. \"Mali-G710\".\n* **Architecture:** The product architecture name string, e.g. \"Valhall\".\n* **Model number:** The product ID number, e.g. 0xa002.\n* **Shader core count:** The number of shader cores in the design.\n* **Shader core mask:** The shader core topology mask.\n* **L2 cache count:** The number of L2 cache slices in the design.\n* **L2 cache size:** The total L2 cache size, summed over all slices, in bytes.\n* **Bus size:** The width of the external data bus, per cache slice, in bits.\n\nThe query mechanism can report the following per-core shader core performance\ninformation:\n\n* **Execution engine count:** The number of arithmetic macroblocks.\n* **FP32 FMA count:** The peak fp32 FMAs per clock, summed over all engines.\n* **FP16 FMA count:** The peak fp16 FMAs per clock, summed over all engines.\n* **Texel count:** The peak bilinear filtered texture samples per clock.\n* **Pixel count:** The peak pixels per clock.\n\n# Using the library\n\nThe library is very simple to use:\n\n```C++\n// Create a connection with the kernel driver ...\nstd::unique_ptr\u003cinstance\u003e conn = libarmgpuinfo::instance::create();\nif (!conn)\n{\n    std::cout \u003c\u003c \"ERROR: Failed to create Mali instance\\n\";\n    return;\n}\n\n// Fetch the information result and do something with it ...\nconst gpuinfo\u0026 info = conn-\u003eget_info();\nstd::cout \u003c\u003c \"GPU: \" \u003c\u003c info.gpu_name \u003c\u003c \" MP\" \u003c\u003c info.num_shader_cores \u003c\u003c \"\\n\";\n```\n\nNote that the returned instance uses a unique pointer for lifetime management,\nand both the instance and the query result will be freed when the instance\ndrops out of scope.\n\n## Handling unknown devices\n\nThe library will be regularly updated to support new Arm GPU products, but it\nis inevitable that applications will run on new devices with GPU models that\ndid not exist at the time they were released. For this there are two failure\nmodes that applications must consider.\n\nThe most likely error is the case where a connection can be established with\nthe Arm kernel driver, but the product code is unknown. In this case the call\nto `libarmgpuinfo::instance::create()` will succeed but return a partially\npopulated result. It will include any information that can be determined\nprogrammatically, but will report the GPU name and architecture as \"Unknown\",\nand the per-core shader core performance metrics as zero.\n\nFor example, we can currently show the following information when the product\nmodel is not explicitly supported:\n\n```yaml\nGPU configuration:\n  Model number: 0xa862\n  Core count: 7\n  L2 cache count: 4\n  Total L2 cache size: 2097152 bytes\n  Bus width: 256 bits\n```\n\nIf the kernel driver interface has changed and the library cannot establish a\nconnection then we can return no useful information. In this case the\n`libarmgpuinfo::instance::create()` function will fail and will return a\n`nullptr`.\n\n# Building\n\nThe library is provided as a single C++ source file and a single C++ header\nfile. It is expected that developers will copy the files directly into their\nexisting application build system, so no off-the-shelf build system is provided\nfor the library integration.\n\n# Sample application\n\nThe repository also contains a simple command line tool that demonstrates use of\nthe API, and which can be used for adhoc testing of devices. To build the\nAndroid command line tool:\n\n* Set `ANDROID_NDK_HOME` to the path of your Android NDK install.\n* Run `./android_build.sh [Release|Debug]`.\n\nThe output binary will be `./bin/arm_gpuinfo`. You can run this on the device\nand print the results for your device to the terminal using the following\ncommands:\n\n```sh\nadb push ./bin/arm_gpuinfo /data/local/tmp\nadb shell chmod u+x /data/local/tmp/arm_gpuinfo\nadb shell /data/local/tmp/arm_gpuinfo\nadb shell rm /data/local/tmp/arm_gpuinfo\n```\n\nThe generated output is formatted using a YAML-like syntax, but is designed for\nhuman consumption with additional line breaks. To generate strictly compliant\nYAML output for use in scripts pass the `--yaml` or `-y` argument on the\n`arm_gpuinfo` command line.\n\n# Support\n\nIf you have issues with the library itself, please raise them in the project's\nGitHub issue tracker.\n\nIf you have any questions about Arm GPUs, application development for Arm GPUs,\nor general mobile graphics development or technology please submit them on the\n[Arm Community graphics forums][1].\n\n- - -\n\n_Copyright © 2023-2024, Arm Limited and contributors._\n\n[1]: https://community.arm.com/support-forums/f/graphics-gaming-and-vr-forum/\n[2]: https://developer.arm.com/documentation/102849/latest/\n[3]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_ARM_shader_core_properties.html\n[4]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_ARM_shader_core_builtins.html\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FARM-software%2FlibGPUInfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FARM-software%2FlibGPUInfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FARM-software%2FlibGPUInfo/lists"}