{"id":28917954,"url":"https://github.com/arthurvasseur/glgpuselect","last_synced_at":"2026-05-19T03:19:53.555Z","repository":{"id":293984135,"uuid":"984364058","full_name":"ArthurVasseur/GLGpuSelect","owner":"ArthurVasseur","description":"GLGpuSelect is a cross-platform drop-in replacement for opengl32.dll on Windows and libGL.so on Linux that enables per-application GPU selection ","archived":false,"fork":false,"pushed_at":"2025-05-28T17:14:00.000Z","size":75,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T01:02:54.285Z","etag":null,"topics":["egl","gpu","gpu-affinity","gpu-association","gpu-selection","multi-gpu","opengl","opengl-context","wgl"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArthurVasseur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-05-15T20:10:27.000Z","updated_at":"2025-05-26T16:59:21.000Z","dependencies_parsed_at":"2025-05-18T11:23:04.515Z","dependency_job_id":"773892e9-f2f4-473a-a753-72bb8fb0dd24","html_url":"https://github.com/ArthurVasseur/GLGpuSelect","commit_stats":null,"previous_names":["arthurvasseur/glgpuselect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ArthurVasseur/GLGpuSelect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurVasseur%2FGLGpuSelect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurVasseur%2FGLGpuSelect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurVasseur%2FGLGpuSelect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurVasseur%2FGLGpuSelect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArthurVasseur","download_url":"https://codeload.github.com/ArthurVasseur/GLGpuSelect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurVasseur%2FGLGpuSelect/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261217813,"owners_count":23126279,"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":["egl","gpu","gpu-affinity","gpu-association","gpu-selection","multi-gpu","opengl","opengl-context","wgl"],"created_at":"2025-06-22T01:03:01.626Z","updated_at":"2026-05-19T03:19:53.549Z","avatar_url":"https://github.com/ArthurVasseur.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://img.shields.io/github/actions/workflow/status/ArthurVasseur/GLGpuSelect/windows.yml)\n![License](https://img.shields.io/badge/License-GPLv3-blue)\n\n# 🚀 GLGpuSelect\n\n**OpenGL GPU Selection • Cross-Platform • Drop‑In Shim • Zero Code Changes**\n\nGLGpuSelect is a **drop‑in replacement** for `opengl32.dll` (Windows) and — coming soon — `libGL.so` (Linux), enabling **per‑application GPU routing** for any OpenGL app. No modifications, no global OS tweaks: just swap in the shim and pick your integrated or discrete GPU.\n\n---\n\n## 📋 Table of Contents\n\n1. [Installation](#-installation)\n2. [Quick Start](#-quick-start)\n3. [Usage](#-usage)\n4. [Examples \u0026 Documentation](#-examples--documentation)\n5. [Repository Structure](#-repository-structure)\n6. [Contributing](#-contributing)\n7. [Releases \u0026 Changelog](#-releases--changelog)\n8. [License](#-license)\n9. [Topics](#-topics)\n\n---\n\n## 🛠️ Installation\n\n### Prerequisites\n\n* **Xmake**: [https://xmake.io/#/](https://xmake.io/#/)\n\n### Clone \u0026 Configure\n\n```bash\ngit clone https://github.com/ArthurVasseur/GLGpuSelect.git\ncd GLGpuSelect\n```\n\n### Configure Build Options\n\n| Flag          | Description                | Default |\n| ------------- | -------------------------- | :-----: |\n| `--examples`  | Build example applications |    no   |\n| `--profiling` | Enable profiling hooks     |    no   |\n| `--tests`     | Build unit tests           |    no   |\n| `--asserts`   | Enable runtime assertions  |    no   |\n| `--logging`   | Enable verbose logging     |    no   |\n\n```bash\nxmake config -m debug --examples=y --profiling=y --tests=y --asserts=y --logging=y\n```\n\n### Build \u0026 Install\n\n#### Using CMake\n\nTo integrate this project into a CMake-based workflow, refer to [xrepo-cmake](https://github.com/xmake-io/xrepo-cmake)\n\n#### Using Xmake\n\n```bash\nxmake         # compile\nxmake install -o /usr/local   # or your chosen path\n```\n\nThen copy the `libGLGpuSelect.so` or `opengl32.dll` to your OpenGL app directory.\n\n---\n\n## 🚀 Quick Start\n\n### Environment Variable\n\n```bash\n# Select GPU by OS adapter index (0 = first GPU, 1 = second, etc.)\nexport GLGPUS_ADAPTER_OS_INDEX=1\n./your_opengl_app\n```\n\n### C API\n\n```c\n#include \u003cGLGpuSelect.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003cstdio.h\u003e\n\nint main(void)\n{\n\tuint32_t deviceCount = 0;\n\tuint32_t result = glgpusEnumerateDevices(\u0026deviceCount, NULL);\n\tif (result != 0)\n\t\treturn EXIT_FAILURE;\n\n\tAdapterInfo* adapters = malloc(deviceCount * sizeof(AdapterInfo));\n\n\tresult = glgpusEnumerateDevices(\u0026deviceCount, adapters);\n\tif (result != 0)\n\t\treturn EXIT_FAILURE;\n\n\tprintf(\"Available devices:\\n\");\n\tfor (uint32_t i = 0; i \u003c deviceCount; ++i)\n\t{\n\t\tprintf(\"\\t%s\\n\", adapters[i].Name);\n\t}\n\n\tglgpusChooseDevice(adapters[0].Uuid);\n\n\tfree(adapters);\n\n\t//Then call your OpenGL init code here ChoosePixelFormat, on windows, eglChooseConfig on Linux, etc.\n\n\treturn EXIT_SUCCESS;\n}\n```\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions!\n\n1. Fork the repo\n2. Create a branch (`git checkout -b feat/awesome`)\n3. Commit (`git commit -m \"Add awesome feature\"`)\n4. Push (`git push origin feat/awesome`)\n5. Open a Pull Request\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on code style, testing, and reviews.\n\n---\n\n## 📜 License\n\nDual‑licensed under:\n\n* **GPL‑3.0** (open‑source): See [LICENSE](LICENSE)\n* **Commercial**: See [COMMERCIAL\\_LICENSE.txt](COMMERCIAL_LICENSE.txt)\n\n---\n\n## 🔖 Topics\n\n`opengl`, `gpu-selection`, `gpu-affinity`, `gpu-routing`, `multi-gpu`, `wgl`, `egl`, `nvoptimus`, `amd-powerxpress`, `cross-platform`, `drop-in`, `shim`, `xmake`, `c-api`, `environment-variables`, `performance`, `hardware-acceleration`, `rendering`, `game-development`, `gpl-3.0`, `dual-license`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurvasseur%2Fglgpuselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurvasseur%2Fglgpuselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurvasseur%2Fglgpuselect/lists"}