Blender 2.81 seems to have broken CLI headless rendering with CUDA GPU.

Here's the Py script people often use: Rendering on command-line with GPU?

  • blender -b *.blend -a -E CYCLES -P script.py
  • Blend file has CUDA enabled on another machine
  • Shows line that says Activating GTX 1080 Ti
  • nvidia-smi shows 0% usage, CPUs are 100%

Any ideas on a fix?

  • 1
    $\begingroup$ The order of your CLI arguments appears to be wrong. The -a should be the last one, otherwise you're starting to render before setting the render engine and enabling the GPUs. Writing this from my phone, will have to verify later. $\endgroup$
    – Robert Gützkow
    Mar 7 '20 at 8:36
  • $\begingroup$ That solved it, strange but works! $\endgroup$ Mar 7 '20 at 21:53
  • $\begingroup$ Great, I will add it as an answer within the next days. It's not strange though, the importance of argument order is also documented in Blender's manual. $\endgroup$
    – Robert Gützkow
    Mar 7 '20 at 21:56

Blender's command line interface executes the argument in the order they are given, as documented in the manual. Therefore your command renders the animation (-a, --render-anim) before executing the Python script (-P, --python). Hence the GPU is enabled after the rendering is already done.

If you put the -a argument last, it should properly render the animation on the GPU.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.