PHPackages                             hmennen90/php-metal-gpu - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hmennen90/php-metal-gpu

ActivePhp-ext[Utility &amp; Helpers](/categories/utility)

hmennen90/php-metal-gpu
=======================

PHP extension for Apple Metal GPU API — compute shaders, render pipelines, ray tracing, mesh shaders

03CCI passing

Since Apr 12Pushed 2mo agoCompare

[ Source](https://github.com/phpolygon/php-metal-gpu)[ Packagist](https://packagist.org/packages/hmennen90/php-metal-gpu)[ RSS](/packages/hmennen90-php-metal-gpu/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-metal
=========

[](#php-metal)

PHP extension for Apple's [Metal GPU API](https://developer.apple.com/metal/). Run compute shaders, render pipelines, and GPU-accelerated workloads directly from PHP.

**macOS only** (Apple Silicon &amp; Intel Macs with Metal support).

Requirements
------------

[](#requirements)

- macOS 14 (Sonoma) or later
- PHP 8.2 - 8.5
- Xcode Command Line Tools (`xcode-select --install`)

Installation
------------

[](#installation)

### Via PIE (recommended)

[](#via-pie-recommended)

```
pie install phpolygon/php-metal-gpu
```

### Pre-built Binaries

[](#pre-built-binaries)

Download platform-specific binaries from the [Releases](https://github.com/phpolygon/php-metal-gpu/releases) page. Available for macOS ARM64 (Apple Silicon) and x86\_64 (Intel).

### From Source

[](#from-source)

```
git clone https://github.com/phpolygon/php-metal-gpu.git
cd php-metal-gpu
phpize
./configure --enable-metal
make -j$(sysctl -n hw.ncpu)
sudo make install
```

Then add to your `php.ini`:

```
extension=metal
```

Quick Start
-----------

[](#quick-start)

### GPU Compute: Add Two Arrays

[](#gpu-compute-add-two-arrays)

```
