主要内容

releaseGPUMemory

R2026b

Move models to CPU and free GPU memory

Since R2026b

Description

Add-On Required: This feature requires the 3D Asset Processing Library for MATLAB add-on.

releaseGPUMemory(trellisObj) moves the Trellis models associated with trellisObj from the GPU to the CPU, and clears the CUDA® memory cache using the trellis object trellisObj. The models move back to the GPU automatically on the next generation or modification call.

Note

This feature requires Deep Learning Toolbox™ and a GPU with at least 16 GB of memory and a CUDA compute capability 7.0 or higher.

example

Examples

collapse all

Note: This example requires Deep Learning Toolbox and a GPU with at least 16 GB of memory and a CUDA compute capability of 7.0 or higher.

Create a trellis object, and generate a 3D asset.

trellisObj = trellis;
meshObj = generateFromText(trellisObj,"A red F1 car");

Move all models associated with this trellis object to CPU, freeing the GPU memory.

releaseGPUMemory(trellisObj)

Generate another asset. All models associated with the trellis object automatically return to the GPU.

meshObj2 = generateFromText(trellisObj,"A blue pickup truck");

Input Arguments

collapse all

Trellis 3D asset generator, specified as a trellis object.

Limitations

macOS does not support generating 3D mesh assets from images or text prompts.

Version History

Introduced in R2026b