Skip to content

feat: Add Apple Silicon GPU support via IOReport API#1541

Merged
aristocratos merged 3 commits intoaristocratos:mainfrom
gneitzke:feature/apple-silicon-gpu-support
Feb 15, 2026
Merged

feat: Add Apple Silicon GPU support via IOReport API#1541
aristocratos merged 3 commits intoaristocratos:mainfrom
gneitzke:feature/apple-silicon-gpu-support

Conversation

@gneitzke
Copy link
Copy Markdown
Contributor

Add GPU monitoring for Apple Silicon Macs using the IOReport framework and IOHIDEventSystem for temperature readings.

Metrics supported:

  • GPU utilization (from GPU Performance States residency)
  • GPU power consumption (from Energy Model channel)
  • GPU temperature (from IOHIDEventSystem thermal sensors)
  • GPU clock speed (from DVFS frequency table + residency weighting)
  • Memory usage (unified memory architecture, reports system RAM)

Implementation follows the existing Nvml/Rsmi/Intel backend pattern with init/shutdown/collect<is_init> template functions in a new AppleSilicon namespace under Gpu.

Build system changes:

  • Enable GPU_SUPPORT on macOS in both CMakeLists.txt and Makefile
  • Link IOReport library on macOS
  • Add 'apple' to shown_gpus vendor filter

Closes #955

Add GPU monitoring for Apple Silicon Macs using the IOReport framework
and IOHIDEventSystem for temperature readings.

Metrics supported:
- GPU utilization (from GPU Performance States residency)
- GPU power consumption (from Energy Model channel)
- GPU temperature (from IOHIDEventSystem thermal sensors)
- GPU clock speed (from DVFS frequency table + residency weighting)
- Memory usage (unified memory architecture, reports system RAM)

Implementation follows the existing Nvml/Rsmi/Intel backend pattern with
init/shutdown/collect<is_init> template functions in a new AppleSilicon
namespace under Gpu.

Build system changes:
- Enable GPU_SUPPORT on macOS in both CMakeLists.txt and Makefile
- Link IOReport library on macOS
- Add 'apple' to shown_gpus vendor filter

Closes aristocratos#955
…builds

- Wrap AppleSilicon::shutdown() call and declaration with #ifdef __APPLE__
  so Linux GPU builds don't get undefined reference errors
- Add IOReport library linking in CMakeLists.txt for macOS CMake builds
@aristocratos aristocratos added the gpu Issues or pull requests related to GPU functionality label Feb 14, 2026
@aristocratos
Copy link
Copy Markdown
Owner

aristocratos commented Feb 14, 2026

Seems to be working fine on an Mac Mini M1 👍

Would you mind creating RAII wrapper classes for the types that needs CFRelease() and IOObjectRelease().
Would be enough with something simple like two templates that takes any of the types used for either.

There is an PR that already covers this #1470, however this PR is a lot more specific (and easier to parse).
@Ruaneri-Portela would you consider removing the GPU specif parts from your PR and just keep the CPU changes.

aristocratos

This comment was marked as resolved.

@Ruaneri-Portela
Copy link
Copy Markdown
Contributor

Seems to be working fine on an Mac Mini M1 👍

Would you mind creating RAII wrapper classes for the types that needs CFRelease() and IOObjectRelease(). Would be enough with something simple like two templates that takes any of the types used for either.

There is an PR that already covers this #1541, however this PR is a lot more specific (and easier to parse). @Ruaneri-Portela would you consider removing the GPU specif parts from your PR and just keep the CPU changes.

Hello, no problem for me. I can revert the GPU code.

I can create a GenericCFObject just to hold via RAII using the directives I made in my iokit.c, if @gneitzke doesn't mind he could use this structure in the implementation to be in accordance with RAII

Comment thread src/btop_config.cpp
- Add CFRef<T> template for CoreFoundation types (CFRelease)
- Add IORef wrapper for IOKit object types (IOObjectRelease)
- Refactor GPU code to use RAII wrappers for all local CF/IO objects
- Add 'apple' to shown_gpus description in btop_menu.cpp
@aristocratos
Copy link
Copy Markdown
Owner

@gneitzke Is this generic for all Apple Silicon GPU's (so far)?

@gneitzke
Copy link
Copy Markdown
Contributor Author

@gneitzke Is this generic for all Apple Silicon GPU's (so far)?

It should be, I ran it on my m3 max and it works great.

@aristocratos
Copy link
Copy Markdown
Owner

Thanks for contributing!

@aristocratos aristocratos merged commit d76e2ca into aristocratos:main Feb 15, 2026
43 checks passed
@aristocratos aristocratos linked an issue Feb 15, 2026 that may be closed by this pull request
@gneitzke gneitzke deleted the feature/apple-silicon-gpu-support branch February 17, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu Issues or pull requests related to GPU functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQUEST] GPU support for Apple Silicon processors [REQUEST] Apple Silicon GPU? 🥺

3 participants