Skip to content

iDontHaveTime/lsgpu-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lsgpu-api

lsgpu is a lightweight C++17 library for querying GPU information using Vulkan. It provides a clean, cross-platform API without exposing Vulkan headers.


Features

  • Detects all GPUs on the system.
  • Reports GPU properties:
    • Name
    • Device ID
    • Vendor ID
    • VRAM size
    • Discrete vs integrated
    • Vulkan API version
  • Minimal dependencies:
    • Only requires Vulkan, and <cstdint> (also <cstring> but it's in the library, not the header)
  • C++ STL-free header

Installation

git clone https://github.com/iDontHaveTime/lsgpu-api.git
cd lsgpu-api

mkdir build
cmake -S . -B build
cmake --build build

./build/lsgpu

API Usage

  • Create a system object to initialize Vulkan and query GPUs:
lsgpu::system sys;
if(!sys){
    // error
}
  • You can then iterate through GPUs with a C++'s for range loop like this:
for(const lsgpu::gpu& gpu : sys.gpus()){
    std::cout<<gpu.get_name()<<std::endl; // prints out the gpu's name
}

Disclaimer

This was tested on Arch Linux x86-64, this has not been tested on other platforms.

About

Lightweight C++17 library for querying GPU information via Vulkan, with a clean, STL-free header.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published