Blender CLI Rendering just stops running mid render

Im currently rendering using blender benchmark script and the offline option noted here: https://opendata.blender.org/about/

For some reason, when I try rendering my scene, it just stops close to the end with no explanation.

Has anyone come across this issue?

As well, is there a way to write the total time rendering to an output file? I see that it does write it to the last line of the command window once it finishes, but is there a command arg/flag that can do that for me?

NOTE: Im currently running that whole blender command in a python subprocess.Popen()

Check the standard error and standard out streams from your Popen() for errors and other interesting messages.

/me bets on a CUDA error
You also might mention what platform you are running on.

Platform is Windows

blender --background --factory-startup -noaudio --enable-autoexec --engine CYCLES classroom_cpu.blend --python main.py -- --device-type CPU

This is the command im using. I was using a CPU blend, so I don’t see why CUDA would be an issue.

This is the little python snippet that kicks off my cmd:

p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=-1)
o, e = p.communicate()
p.wait()
print(o)
print(e)

There’s no need to call p.wait(), communicate() already waits for the process to terminate. Perhaps the wait() call is what’s blocking?

The total render time is in the command-line output, no?

$ blender -b -f 1
...
Fra:1 Mem:48.62M (0.00M, Peak 89.17M) | Time:00:02.08 | Sce: Scene Ve:0 Fa:0 La:0
Saved: '/tmp/0001.png'
 Time: 00:02.57 (Saving: 00:00.49)
 ^^^^^^^^^^^^^^

Edit: you can simply make a regexp with the re module and extract it from the values returned from communicate()

I was just looking for this and you are the only one who seems to have had this issue. If you’ve solved it since then, did you do anything in particular?

-Right now I am working with Blender 2.90.1.
-Rendering from CLI
-Nothing fancy, just “-blender <path_to_file> -a” so that I can batch multiple projects at once, overnight.

Somewhere after aprox. 1 hour, the render just hangs. No error, no problems, nothing: it just looks like it’s still rendering but it doesn’t move past a certain line (like “Rendered x/y tiles” but sits there indefinitely).

Closing the cmd window and restarting the rendering works fine, but seeing next morning that only 100 of 1000 frames have been done is not fun :frowning:

I’m using 2.91 for these cases aswell, as it hangs less, but I’ve noticed this problem with that version aswell (although… to be honest, it’s a development branch, so issues are to be expected).

Final note: I have tweaked Windows Power settings so that the HDD (SSD) & windows & anything really don’t go in idle/sleep mode, although Blender actively working should already prevent that from happening.

Maybe I should make a bug report out of this?

Yes, this is the type of problem that should be reported as a bug, with an as simple as possible .blend file to reproduce.