GPU Backends
Morph selects GPU computing backends in priority order with CPU fallback.
Backend Priority
| Priority | Backend | Requirements |
|---|---|---|
| 1 | CUDA | NVIDIA GPU + CUDA toolkit |
| 2 | Vulkan | Any GPU with Vulkan driver |
| 3 | CPU | Always available (fallback) |
Environment Variables
Names match the tensor / GPU runtime probes (e.g. tests/runtime/test_tensor_runtime.cpp), not the branding macros in Branding.generated.h:
| Variable | Description |
|---|---|
MORPHLANG_GPU_FORCE_BACKEND | Force a specific backend (cuda, vulkan, cpu) |
MORPHLANG_GPU_DUMP_METRICS | Print GPU performance timing after each block |
MORPHLANG_GPU_READBACK_OPT | Skip unnecessary GPU-to-CPU data transfers |
Checking GPU Availability
The runtime automatically detects available GPUs. Use MORPHLANG_GPU_DUMP_METRICS=1 to see which backend was selected.
Next Steps
- Scope Batching — Batched GPU dispatch