Page 1 of 1

Rendering script unresponsive: "second pass render finished"

Posted: Wed Jul 04, 2018 7:15 pm
by Vivian Paulun
Hello,
I simulated a few simple soft body scenes in Realflow 10, saved them in *.mxs format and wrote a script to load and render these scenes in Maxwell 4 (see attachement).
In principle, everything is working fine. I am using the denoiser running on GPU, and the script is loading all the frames of different scenes and renders them as it should.
However, for some reason, the script keeps crahsing at (random?) intervals, telling me that "second pass render finished" (output command window) and staying unresponsive. It is not proceeding to render, even after hours, just when I hit STRG+C two times to skip the current render, it jumps to the next one. Running the denoiser on CPU does not change this weird behaviour
Is there some mistake in my script? What is happening?
Of course, I would like to run this (in total quite extensive) rendering job for days and not just for some minutes or hours up to the next crash...
It would be great if someone could give me some advice.
Best, Filipp
renderSimulationsInMaxwell_example.zip

Re: Rendering script unresponsive: "second pass render finished"

Posted: Thu Jul 05, 2018 12:02 pm
by Brany
Hello Vivian.

It seems that maxwell.exe (your script seems perfect) has a random crash closing the application when the denoised render has finished. We will try to find what is happening for the next version release, meanwhile you can try to run maxwell in a different way. I am not sure if this can be a solution (I have not tested it), but instead of calling "runMaxwell", you can try to use the python "subprocess" package by yourself, and kill the process when you consider that it is taking to much time (using timers).
Code: Select all
import subprocess
....
parameters = []
parameters.append('/your/maxwell/location/maxwell.exe')
parameters.append('-nogui')
....
p  = subprocess.Popen(parameters)
# start timer here
while True:
  status = p.poll()
  # if status indicates that the process has finished
    # the process has finished, just leave the "poll loop"
    break
  # if timer indicates that the render is taking too much time:
    p.terminate() # or p.send_signal(....), or p.kill() to force maxwell.exe to end and leave the "poll loop"
    break
I hope this helps.

Re: Rendering script unresponsive: "second pass render finished"

Posted: Thu Jul 05, 2018 12:10 pm
by Brany
In fact, I see you can try to read the maxwell.exe ouput messages using the Popen.communicate method

https://docs.python.org/2/library/subpr ... ommunicate

This can help you to determinate the render state before killing it by hand.

One question: when maxwell crashes, the render result files are created?

Re: Rendering script unresponsive: "second pass render finished"

Posted: Thu Jul 05, 2018 2:41 pm
by Vivian Paulun
Hi Brany,
thanks for your response. When plugging in your code using "p = subprocess.Popen(parameters)...", the script is running but it stops to render after a very short time, producing output images of very low sampling rate. The second render pass is not started at all. Does that mean that the termination signal from "status = p.poll()" is received after each sampling level? Do you have any idea what's happening?
Best
P.S. When maxwell crashes with the original code, only the image files for the first pass, but not for the denoiser were produced.

Re: Rendering script unresponsive: "second pass render finished"

Posted: Fri Jul 06, 2018 10:30 am
by Brany
If maxwell crashes before the denoising process finished, this is worst than I though. We will try to fix this as soon as possible.

The details of the "poll" return value are unknown to me. Maybe you will have to test the values that poll returns without killing the application at all, and then check the proper value.

Re: Rendering script unresponsive: "second pass render finished"

Posted: Sun Jul 08, 2018 10:30 pm
by Vivian Paulun
Ok, I could not solve the problem yet, and I don't really know what to try next.
Please tell me as soon as possible if you happen to fix the problem.
Thanks

Re: Rendering script unresponsive: "second pass render finished"

Posted: Mon Jul 09, 2018 5:49 pm
by Brany
Sorry, we can't give high priority to this issue, and it seems hard to reproduce (I am not able to make it crash).

We can try to find a workaround anyway. Did you test the memory usage on your computer running the script? Maybe a memory leak is happening in your script and maxwell get stuck at some point if the RAM is full. I guess that this is not the problem since you use the freeScene method properly.

By the way, I see some code that is doing nothing::
Code: Select all
					# enable GPU rendering
					scene.setRenderParameter('ENGINE','RSC');
					scene.setRenderParameter('STOP RENDER IF NO PHYSICAL MEMORY',0)
					scene.setRenderParameter('STOP RENDER IF EXTENSION ERROR',0)
this is modifying an already written to disk scene, so it doesn't affects the render at all.

Re: Rendering script unresponsive: "second pass render finished"

Posted: Mon Jul 09, 2018 6:07 pm
by Brany
This is a long shot, but: can you try adding to your script the following statement?
Code: Select all
parameters.append('-denoiseShadow:off');

Re: Rendering script unresponsive: "second pass render finished"

Posted: Thu Jul 12, 2018 5:40 pm
by Vivian Paulun
Hi Brany,

I waited 2 days to be sure but your long shot seems to work: I did not have any crash any more since adding
parameters.append('-denoiseShadow:off');

Thanks a lot, this made my day!
All the best

Re: Rendering script unresponsive: "second pass render finished"

Posted: Fri Jul 13, 2018 3:05 pm
by Brany
Great! Nice to hear that.