RenderToolbox / RenderToolbox4

Matlab toolbox for managing 3D scenes and physically-based rendering.
MIT License
48 stars 7 forks source link

Seg Fault on Docker? #27

Closed tlian7 closed 7 years ago

tlian7 commented 7 years ago

I'm trying to get RTB4 setup on one of our OSX machines, this time using the pre-built mex files for ReadMultichannelEXR. (Building those files had been my main obstacle in the past to getting everything setup on this specific machine.) As @benjamin-heasly suggested, I downloaded the pre-built files: "ReadMultichannelEXR.mexa64" and "ReadMultichannelEXR.mexmaci64" and placed them in the /RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR folder.

As usual, I also have mexximp which I've built successfully (ran makeMexximp.m), as well as the mPbrt and RTB4 repo's in my working directory. I'm also certain that I have Assimp and OpenEXR.

Upon trying to run an example scene such as rtbMakeSimpleSphere I run into an error that I can't figure out how to debug. The docker container runs successfully, and the image actually renders according to the output, but once the rendering finishes there is a segmentation fault and no files are output.

(I've actually taken the PBRT file and ran it on my local compiled version of PBRT, and the expected image was produced as usual. Therefore, I don't think this is an issue with PBRT at all.)

The output from running the docker command looks something like this:

command:

docker run -ti --rm --user="503":"503" --workdir="/Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere" --volume="/Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere":"/Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere" --volume="/Users/trishalian/GitRepos/RenderToolbox4":"/Users/trishalian/GitRepos/RenderToolbox4" ninjaben/pbrt-v2-spectral-docker pbrt --outfile /Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere/renderings/PBRT/scene-001.dat /Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere/scene-001.pbrt

output:

system(command); pbrt version 2.0.0 of Jul 13 2016 at 19:16:33 [Detected 1 core(s)]

Copyright (c)1998-2010 Matt Pharr and Greg Humphreys.

The source code to pbrt (but not the book contents) is covered by the GNU GPL.

..... ..... etc
..... .....

Rendering: [++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++] (1.5s)
Rendering: [++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++] (1.5s)

docker run -ti --rm --user="503":"503" --workdir="/Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere" --volume="/Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere":"/Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere" --volume="/Users/trishalian/GitRepos/RenderToolbox4":"/Users/trishalian/GitRepos/RenderToolbox4" ninjaben/pbrt-v2-spectral-docker pbrt --outfile /Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere/renderings/PBRT/scene-001.dat /Users/trishalian/GitRepos/render_toolbox/rtbMakeSimpleSphere/scene-001.pbrt: Segmentation fault

Do you have any ideas for how to debug? I'm not really sure how to proceed from here and I'd be grateful if you had any ideas!

tlian7 commented 7 years ago

I discovered the issue, it had to do with file permissions on the working directory ("render_toolbox"). Although things could render, the output could not be written out.

I uncovered this when I tried running the docker command for Mitsuba directly in the terminal and it gave me an error after rendering about not being able to access the output file. Unfortunately, PBRT had not given me such a helpful message, which had contributed to my confusion.

Changing the file permissions on the working folder solved the issue.