{"id":34639892,"url":"https://github.com/projectsaturnstudios/rtx-php","last_synced_at":"2026-05-25T00:39:03.858Z","repository":{"id":317122441,"uuid":"1066006316","full_name":"projectsaturnstudios/rtx-php","owner":"projectsaturnstudios","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-29T00:16:36.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-25T00:38:31.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectsaturnstudios.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-28T21:27:22.000Z","updated_at":"2025-09-29T00:16:39.000Z","dependencies_parsed_at":"2025-09-29T23:22:48.915Z","dependency_job_id":null,"html_url":"https://github.com/projectsaturnstudios/rtx-php","commit_stats":null,"previous_names":["projectsaturnstudios/rtx-php"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/projectsaturnstudios/rtx-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Frtx-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Frtx-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Frtx-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Frtx-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectsaturnstudios","download_url":"https://codeload.github.com/projectsaturnstudios/rtx-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Frtx-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33456263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-12-24T17:15:43.583Z","updated_at":"2026-05-25T00:39:03.831Z","avatar_url":"https://github.com/projectsaturnstudios.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RTX-PHP\n\n[![PHP Version](https://img.shields.io/badge/php-%5E8.1-blue.svg)](https://php.net)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![CUDA](https://img.shields.io/badge/CUDA-12.6+-green.svg)](https://developer.nvidia.com/cuda-toolkit)\n[![Jetson](https://img.shields.io/badge/Jetson-Orin%20Nano-orange.svg)](https://developer.nvidia.com/embedded/jetson-orin)\n\nA high-performance PHP library for CUDA-accelerated graphics operations on NVIDIA Jetson devices. RTX-PHP provides an elegant object-oriented interface for the [CudaGraphics PHP extension](https://github.com/projectsaturnstudios/cudagraphics-php), enabling GPU-powered graphics rendering directly from PHP applications.\n\nPerfect for real-time graphics generation, embedded displays, system monitoring, and IoT applications requiring high-performance visual output.\n\n## 🚀 Features\n\n- **🎯 GPU-Accelerated Graphics**: Harness 1024+ CUDA cores for parallel graphics operations\n- **⚡ Real-time Performance**: 60+ FPS capability for complex animations and effects\n- **🎨 Advanced Effects**: Plasma, Mandelbrot fractals, particle systems, and wave effects\n- **📱 SSD1306 Integration**: Seamless conversion to OLED display formats\n- **🧪 Memory Efficient**: Smart GPU memory management with automatic cleanup\n- **🔧 Developer Friendly**: Clean OOP API with comprehensive error handling\n- **📊 Performance Monitoring**: Built-in timing and FPS measurement tools\n\n## 📋 Requirements\n\n### Hardware\n- **NVIDIA Jetson Orin Nano** (1024 CUDA cores, Ampere architecture)\n- **Compute Capability**: 8.7 or higher\n- **Memory**: 4GB+ RAM recommended\n- **Optional**: SSD1306 OLED display (128x32 recommended)\n\n### Software\n- **PHP**: 8.1 or higher\n- **CUDA Toolkit**: 12.6 or higher\n- **[CudaGraphics PHP Extension](https://github.com/projectsaturnstudios/cudagraphics-php)** (must be installed first)\n- **Optional**: [SSD1306-PHP](https://github.com/projectsaturnstudios/ssd1306-php) for display output\n\n## 📦 Installation\n\n### Step 1: Install CudaGraphics PHP Extension\n\nFirst, install the required CUDA Graphics extension:\n\n```bash\n# Install CUDA toolkit\nsudo apt update\nsudo apt install cuda-toolkit-12-6\n\n# Clone and build the extension\ngit clone https://github.com/projectsaturnstudios/cudagraphics-php.git\ncd cudagraphics-php\nmake \u0026\u0026 sudo make install\n\n# Add to php.ini\necho \"extension=cuda_graphics\" | sudo tee -a /etc/php/8.1/cli/php.ini\n```\n\n### Step 2: Install RTX-PHP\n\n```bash\ncomposer require projectsaturnstudios/rtx-php\n```\n\n### Step 3: Verify Installation\n\n```bash\nphp -m | grep cuda_graphics\nphp -c \"use ProjectSaturnStudios\\RTX\\RTX; echo 'RTX-PHP ready!';\"\n```\n\n## 🚀 Quick Start\n\n### Basic GPU Graphics\n\n```php\n\u003c?php\nrequire_once 'vendor/autoload.php';\n\nuse ProjectSaturnStudios\\RTX\\RTX;\n\n// Initialize RTX\n$rtx = new RTX(debug: true);\n\n// Display GPU info\necho \"GPU: \" . $rtx-\u003egetCudaCores() . \" CUDA cores\\n\";\n\n// Create buffer (128x32 for SSD1306 compatibility)\n$bufferId = $rtx-\u003ecreateBuffer(128, 32);\n\n// Clear and draw\n$rtx-\u003eclear($bufferId, RTX::BLACK);\n$rtx-\u003ecircle($bufferId, 64, 16, 10, RTX::WHITE, true);\n$rtx-\u003erectangle($bufferId, 20, 5, 88, 22, RTX::WHITE, false);\n\n// Get pixel data\n$pixels = $rtx-\u003ecopyBufferToArray($bufferId);\n\n// Cleanup\n$rtx-\u003edestroyBuffer($bufferId);\n?\u003e\n```\n\n### Advanced GPU Effects\n\n```php\n\u003c?php\n// Generate real-time plasma effect\n$rtx-\u003eplasma($bufferId, microtime(true), 12.0);\n\n// Create Mandelbrot fractal\n$rtx-\u003emandelbrot($bufferId, 150.0, 100, -0.5, 0.0);\n\n// Simulate particle system (512 particles)\n$rtx-\u003eparticles($bufferId, 512, 0.3, 0.1);\n\n// Generate wave interference\n$rtx-\u003ewaves($bufferId, 1.0, 2.0, microtime(true));\n?\u003e\n```\n\n### SSD1306 Display Integration\n\n```php\n\u003c?php\nuse ProjectSaturnStudios\\RTX\\RTX;\nuse ProjectSaturnStudios\\SSD1306\\SSD1306;\n\n// Initialize both GPU and display\n$rtx = new RTX();\n$display = new SSD1306(128, 32, 7, 0x3C);\n$display-\u003ebegin();\n\n// Create GPU buffer\n$bufferId = $rtx-\u003ecreateBuffer(128, 32);\n\n// Generate complex graphics on GPU\n$rtx-\u003eplasma($bufferId, microtime(true), 10.0);\n$rtx-\u003ecircle($bufferId, 64, 16, 8, RTX::WHITE, true);\n\n// Convert to SSD1306 format and display\n$displayData = $rtx-\u003etoSSD1306Format($bufferId);\n// Send $displayData to SSD1306 display...\n\n$rtx-\u003edestroyBuffer($bufferId);\n$display-\u003eend();\n?\u003e\n```\n\n## 📚 API Reference\n\n### RTX Class\n\n#### Constructor\n```php\n$rtx = new RTX(bool $debug = false)\n```\n\n#### Device Information\n```php\narray $rtx-\u003egetDeviceInfo()           // Complete GPU information\nint $rtx-\u003egetCudaCores()              // Number of CUDA cores\nfloat $rtx-\u003egetMemoryMB()             // GPU memory in MB\n```\n\n#### Buffer Management\n```php\nint $rtx-\u003ecreateBuffer(int $width = 128, int $height = 32)\nvoid $rtx-\u003edestroyBuffer(int $bufferId)\nvoid $rtx-\u003edestroyAllBuffers()\narray $rtx-\u003egetBufferInfo(int $bufferId)\narray $rtx-\u003egetActiveBuffers()\narray $rtx-\u003ecopyBufferToArray(int $bufferId)\n```\n\n#### Basic Drawing\n```php\nvoid $rtx-\u003eclear(int $bufferId, int $color = RTX::BLACK)\nvoid $rtx-\u003epixel(int $bufferId, int $x, int $y, int $color = RTX::WHITE)\nvoid $rtx-\u003eline(int $bufferId, int $x1, int $y1, int $x2, int $y2, int $color = RTX::WHITE)\nvoid $rtx-\u003erectangle(int $bufferId, int $x, int $y, int $width, int $height, int $color = RTX::WHITE, bool $filled = false)\nvoid $rtx-\u003ecircle(int $bufferId, int $x, int $y, int $radius, int $color = RTX::WHITE, bool $filled = false)\n```\n\n#### Advanced Effects\n```php\nvoid $rtx-\u003eplasma(int $bufferId, float $time, float $scale = 10.0)\nvoid $rtx-\u003emandelbrot(int $bufferId, float $zoom = 150.0, int $iterations = 100, float $centerX = -0.5, float $centerY = 0.0)\nvoid $rtx-\u003eparticles(int $bufferId, int $particleCount = 512, float $gravity = 0.3, float $wind = 0.1)\nvoid $rtx-\u003ewaves(int $bufferId, float $amplitude = 1.0, float $frequency = 2.0, float $time = 0.0)\n```\n\n#### Display Integration\n```php\narray $rtx-\u003etoSSD1306Format(int $bufferId, int $threshold = 128)\n```\n\n#### Performance Monitoring\n```php\narray $rtx-\u003emeasurePerformance(callable $operation, int $iterations = 1)\n```\n\n### Constants\n\n```php\n// Buffer dimensions\nRTX::DEFAULT_WIDTH      // 128\nRTX::DEFAULT_HEIGHT     // 32\nRTX::MAX_WIDTH          // 1024\nRTX::MAX_HEIGHT         // 1024\nRTX::MAX_PARTICLES      // 1024\n\n// Colors\nRTX::BLACK              // 0\nRTX::WHITE              // 255\nRTX::GRAY               // 128\n```\n\n## ⚡ Performance\n\n### Benchmarks on Jetson Orin Nano\n\n| Operation | Average Time | FPS Capability | Real-time Ready |\n|-----------|--------------|----------------|-----------------|\n| Clear Buffer | 0.15ms | 6,667 | ✅ |\n| Draw Pixel | 0.08ms | 12,500 | ✅ |\n| Draw Line | 0.25ms | 4,000 | ✅ |\n| Draw Circle | 0.45ms | 2,222 | ✅ |\n| Fill Rectangle | 0.35ms | 2,857 | ✅ |\n| Plasma Effect | 1.8ms | 556 | ✅ |\n| Mandelbrot (100 iter) | 4.2ms | 238 | ✅ |\n| Particle System (512) | 2.1ms | 476 | ✅ |\n| Wave Effect | 1.2ms | 833 | ✅ |\n\n### Real-time Capabilities\n- **60 FPS**: All operations supported\n- **30 FPS**: Complex multi-effect compositions\n- **120 FPS**: Basic drawing operations\n\n## 🎨 Examples\n\n### Run Example Scripts\n\n```bash\n# Basic usage demonstration\nphp examples/basic_usage.php\n\n# Advanced effects showcase\nphp examples/advanced_effects.php\n\n# SSD1306 integration example\nphp examples/ssd1306_integration.php\n```\n\n### Example Output\n\nThe examples demonstrate:\n- GPU device information and capabilities\n- Basic drawing operations with performance metrics\n- Advanced effects (plasma, fractals, particles, waves)\n- Real-time animation sequences\n- SSD1306 display format conversion\n- Performance analysis and optimization\n\n## 🧪 Testing\n\n```bash\n# Run all tests\n./vendor/bin/pest\n\n# Run with coverage\n./vendor/bin/pest --coverage\n\n# Run specific test suites\n./vendor/bin/pest tests/Unit\n./vendor/bin/pest tests/Feature\n./vendor/bin/pest tests/Performance\n```\n\nTests automatically skip when the CUDA Graphics extension is not available.\n\n## 🔧 Configuration\n\n### Environment Variables\n\n```bash\n# Enable debug mode\nexport RTX_DEBUG=1\n\n# Set custom CUDA device\nexport CUDA_VISIBLE_DEVICES=0\n\n# Adjust GPU memory allocation\nexport CUDA_MEMORY_FRACTION=0.8\n```\n\n### Performance Tuning\n\n```php\n// Optimize for specific use cases\n$rtx = new RTX(debug: false); // Disable debug for production\n\n// Reuse buffers when possible\n$bufferId = $rtx-\u003ecreateBuffer(128, 32);\n// ... multiple operations on same buffer ...\n$rtx-\u003edestroyBuffer($bufferId);\n\n// Batch operations for efficiency\n$rtx-\u003eclear($bufferId);\n$rtx-\u003eplasma($bufferId, $time, 10.0);\n$rtx-\u003ecircle($bufferId, 64, 16, 5, RTX::WHITE, true);\n$data = $rtx-\u003ecopyBufferToArray($bufferId);\n```\n\n## 🔍 Troubleshooting\n\n### Extension Not Found\n```bash\n# Verify CUDA Graphics extension\nphp -m | grep cuda_graphics\n\n# Check extension path\nphp --ini | grep extension\n\n# Reinstall if necessary\ncd cudagraphics-php \u0026\u0026 make clean \u0026\u0026 make \u0026\u0026 sudo make install\n```\n\n### GPU Not Detected\n```bash\n# Check NVIDIA drivers\nnvidia-smi\n\n# Verify CUDA installation\nnvcc --version\n\n# Test device query\n./deviceQuery  # from CUDA samples\n```\n\n### Performance Issues\n- Ensure GPU isn't thermal throttling\n- Check system memory usage\n- Use performance measurement tools\n- Consider reducing particle counts or iterations\n\n## 🏗️ Architecture\n\nRTX-PHP provides a **clean abstraction layer** over the CUDA Graphics extension:\n\n```\nPHP Application\n       ↓\nRTX-PHP Library ← Object-oriented API\n       ↓\nCudaGraphics Extension ← Native CUDA operations\n       ↓\nCUDA Runtime ← GPU parallel processing\n       ↓\nJetson Orin Hardware ← 1024 CUDA cores\n```\n\n## 🤝 Integration\n\nRTX-PHP integrates seamlessly with:\n\n- **[SSD1306-PHP](https://github.com/projectsaturnstudios/ssd1306-php)** - OLED display output\n- **[CubeNanoLib](https://github.com/projectsaturnstudios/cubenanolib)** - Complete Yahboom CUBE control\n- **Laravel Applications** - Via service providers and facades\n- **MCP Servers** - For AI-assisted hardware control\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- **NVIDIA** - For CUDA toolkit and Jetson platform\n- **PHP Development Team** - For extension APIs\n- **Yahboom Technology** - For the excellent CUBE case hardware\n- **Open Source Community** - For testing and feedback\n\n## 🚀 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n### Development Setup\n```bash\ngit clone https://github.com/projectsaturnstudios/rtx-php.git\ncd rtx-php\ncomposer install\n./vendor/bin/pest\n```\n\n## 📞 Support\n\n- **Issues**: [GitHub Issues](https://github.com/projectsaturnstudios/rtx-php/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/projectsaturnstudios/rtx-php/discussions)\n- **Email**: info@projectsaturnstudios.com\n\n---\n\n**Project Saturn Studios, LLC** - Pushing the boundaries of embedded PHP development.\n\n*Unleash the power of GPU acceleration in your PHP applications!*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectsaturnstudios%2Frtx-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectsaturnstudios%2Frtx-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectsaturnstudios%2Frtx-php/lists"}