Skip to main content

GPU Backends

Morph selects GPU computing backends in priority order with CPU fallback.


Backend Priority

PriorityBackendRequirements
1CUDANVIDIA GPU + CUDA toolkit
2VulkanAny GPU with Vulkan driver
3CPUAlways 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:

VariableDescription
MORPHLANG_GPU_FORCE_BACKENDForce a specific backend (cuda, vulkan, cpu)
MORPHLANG_GPU_DUMP_METRICSPrint GPU performance timing after each block
MORPHLANG_GPU_READBACK_OPTSkip 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