https://github.com/offerrall/cuda_render
https://github.com/offerrall/cuda_render
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/offerrall/cuda_render
- Owner: offerrall
- Created: 2024-11-12T19:56:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-05T16:38:03.000Z (over 1 year ago)
- Last Synced: 2025-01-26T03:15:22.810Z (over 1 year ago)
- Language: Python
- Size: 1.25 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# CUDA Render
Simple CUDA buffer renderer using OpenGL for display.
## Requirements
- CUDA Toolkit
- OpenGL
- SDL2
- Python 3.6+
- CFFI
## Installation
1. Build the C++ library:
Modify the build script build.py in cuda_render_src to match your system configuration.
Then run the following commands:
```bash
cd cuda_render_src
./compile_lib.bat # or compile using your preferred method
```
2. Install the Python package:
```bash
pip install -e .
```
## Usage
```python
import cuda_render
import cupy as cp # or your CUDA framework of choice
# Create renderer
renderer = cuda_render.create_renderer(width=800, height=600)
# Main loop
while not cuda_render.should_quit(renderer):
# Your CUDA buffer here (RGBA format)
cuda_buffer = ...
cuda_render.display_buffer(renderer, cuda_buffer)
# Cleanup
cuda_render.destroy_renderer(renderer)
```
## License
MIT