GPU acceleration

If you have code or use libraries that are GPU accelerated, you can enable GPU usage for your functions by simply passing the gpu=True argument to your stub.function decorator:

import modal

stub = modal.Stub()

def my_function():
    # code here will be executed on a machine with an available GPU


One example program that uses GPU acceleration is the Blender video renderer.