-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Summary
The current GPU miner uses OpenCL, which is deprecated on macOS and has limited/no support on Apple Silicon Macs. To properly support M1/M2/M3/M4 chips, we need to implement a Metal-based GPU miner.
Current State
gpu_darwin.gouses OpenCL 1.2 via-framework OpenCL- Works well on Intel Macs with discrete AMD GPUs (e.g., Radeon Pro 555X, 560X, 5500M)
- On Apple Silicon, OpenCL either:
- Doesn't detect the GPU at all
- Runs through an emulation layer with poor performance
Proposed Solution
Implement a Metal-based GPU miner for Apple Silicon:
- Create
gpu_darwin_metal.gowith Metal compute shaders - Port the Keccak256 kernel (
kernel/keccak256.cl) to Metal Shading Language (MSL) - Use build tags to select between OpenCL (Intel Macs) and Metal (Apple Silicon)
- Alternatively, use Metal for all macOS builds since it works on both Intel and Apple Silicon
Technical Considerations
- Metal uses MSL (Metal Shading Language) instead of OpenCL C
- Need to use
cgowith-framework Metal -framework Foundation - Consider using go-metal or direct cgo bindings
- Metal provides better performance on Apple hardware than OpenCL
Benefits
- Native GPU acceleration on M1/M2/M3/M4 Macs
- Better performance than OpenCL even on Intel Macs
- Future-proof as Apple continues to deprecate OpenCL
References
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed