Page MenuHome

Running 2 Instances with the Same Filename corrupts the Temp EXR image file
Closed, ArchivedPublic

Description

System Information
OSX 10.8.5
Nvidia GTX 580

Blender 2.6x (have not tested it in earlier versions)

I often need to run 2 instances of Blender when rendering. One using the CPU and one using GPU. I have found that if load the exact same file without renaming it, that during the render process both instances of Blender write to a temporary EXR file using the exact same filename. This almost always results in one (usually whichever render finished first) of the EXR's being corrupted.

Open the attached bugtext.blend file (attached) in 2 instances of Blender on the same machine. Set one to CPU rendering and one to GPU rendering. Hit render in both instances. The one that finishes first will be corrupted and display a blank render screen.

Event Timeline

Todd McIntosh (tmcintosh) raised the priority of this task from to 90.
Todd McIntosh (tmcintosh) updated the task description. (Show Details)
Todd McIntosh (tmcintosh) edited a custom field.

First instance output:
write exr tmp file, 960x540, /tmp/bugtest.blend_Scene_RenderLayer.exr
read exr tmp file: /tmp/bugtest.blend_Scene_RenderLayer.exr
OpenEXR-readPixels: ERROR: Error reading pixel data from image file "/tmp/bugtest.blend_Scene_RenderLayer.exr". Unexpected tile x coordinate.

Second instance output:
write exr tmp file, 960x540, /tmp/bugtest.blend_Scene_RenderLayer.exr
read exr tmp file: /tmp/bugtest.blend_Scene_RenderLayer.exr

Brecht Van Lommel (brecht) lowered the priority of this task from 90 to 50.Dec 31 2013, 1:51 AM

This is an old design problem, the temp file thing has basically two uses which gives issues in this case. It's used as temporary storage during renders, but it's also used as a kind of cache so that when you restart Blender or reopen a file, the last render can be loaded and you can do compositing without having to re-render.

Thanks for having a look at this Brecht. The TMP file just needs a unique name for each instance instead of just based on the filename alone.

Is there any type of id or data that is unique to the instance that could be appended to the filename? Or perhaps just a timestamp (down to milliseconds), as I never launch both instances exactly at the same time.

It's easy to add the process ID, but this would give a ton of files and disk space usage in the /tmp directory as they aren't actually removed after rendering, especially if you are using a background render with a Blender process for each frame. And it doesn't work with file reloading for compositing because the process ID would be different, so that needs to be solved too.

The design needs to be thought out more rather than just using unique filenames.

So is this an issue for background command-line rendering too?

You can use separate temp folder for command-line rendering.

This issue has been discussed already (see T28314), And since it's a design limitation rather than the bug archiving this report.

Thanks for the report anyway.

Sergey Sharybin (sergey) changed the task status from Unknown Status to Unknown Status.Jan 17 2014, 12:27 PM
Sergey Sharybin (sergey) claimed this task.