<div dir="ltr">Hi Sergey,<br><br>it didn't solve the issue "although I guess it is a part of the crash, so there is another part that crashes it here too" , it crashes in both CPU and CUDA, when I tested with CUDA it throws this message:<br>ILLEGAL_ADDRESS in cuCtxSynchronize()<br><br>here is the code that I'm using for the function callback:<br><br><div>void rContextHandler::r_C4D_write_tile(RenderTile& rtile)</div><div>{</div><div><span class="" style="white-space:pre">        </span>BufferParams& params = rtile.buffers->params;</div><div><span class="" style="white-space:pre">        </span>int x = params.full_x - options.session->tile_manager.params.full_x;</div><div><span class="" style="white-space:pre">        </span>int y = params.full_y - options.session->tile_manager.params.full_y;</div><div><span class="" style="white-space:pre">        </span>int w = params.width;</div><div><span class="" style="white-space:pre">        </span>int h = params.height;</div><div><br></div><div><span class="" style="white-space:pre">        </span>RenderBuffers *buffers = rtile.buffers;</div><div><br></div><div><span class="" style="white-space:pre">        </span>/* copy data from device */</div><div><span class="" style="white-space:pre">        </span>if (!buffers->copy_from_device())</div><div><span class="" style="white-space:pre">                </span>return;</div><div><br></div><div><span class="" style="white-space:pre">        </span>float exposure = scene->film->exposure;</div><div><span class="" style="white-space:pre">        </span>std::vector<float> pixels(params.width*params.height * 4);</div><div><br></div><div><span class="" style="white-space:pre">        </span>if (buffers->get_pass_rect(PASS_COMBINED, exposure, rtile.sample, 4, &pixels[0]))</div><div><span class="" style="white-space:pre">                </span>write_c4d(&pixels[0], x, y, w, h);</div><div><br></div><div><span class="" style="white-space:pre">        </span>return;</div><div>}</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 19, 2015 at 9:40 AM, Sergey Sharybin <span dir="ltr"><<a href="mailto:sergey.vfx@gmail.com" target="_blank">sergey.vfx@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I can't reproduce issue with missing update/write callbacks call here, this all works just fine here by the looks of it. Also not sure why would commenting buffers deletion make things work to you. Either you're referencing buffers in the callback or maybe it is related to the next issue.<div><br></div><div>Bet you've got default start resolution of 64 in the settings. This makes it so frame first renders with lower resolution and then goes to a final resolutions. This for sure causes number of tiles to be changed, which is not supported by progressive refine in the background mode.</div><div><br></div><div>Surely we can add some checks in the session constructor to verify the settings, but for until then just manually control the settings on your side.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, May 19, 2015 at 3:21 AM, Mohamed Sakr <span dir="ltr"><<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<br><br> I'm creating a render engine based on Cycles, right now everything is fine except that the function callbacks "<font color="#4b4d51" face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height:16.0030002593994px">write_render_tile_cb, update_render_tile_cb" and variables "progressive, progressive_refine" are making a problem!!</span></font><br><br><font color="#4b4d51" face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height:16.0030002593994px">the problem is:</span></font><br><font color="#4b4d51" face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height:16.0030002593994px">case (1):<br></span></font><div><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive = true;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive_refine = true;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive_update_timeout = 0.1;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.background = true;</div><br><font color="#4b4d51" face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height:16.0030002593994px">no feedback is given "from both functions, so they are not called" , at the end of the render it saves the image on destructor.</span></font><br><br><font color="#4b4d51" face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height:16.0030002593994px">case (2):</span></font><br><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive = false;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive_refine = false;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive_update_timeout = 0.1;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.background = true;<br><br>crash!! after first tile, shows 12/192 in tiles and crashes.<br><br>case (3):<br><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive = false;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive_refine = false;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.progressive_update_timeout = 0.1;</div><div><span style="white-space:pre-wrap">        </span>options.session_params.background = true;<br><br>and in session.cpp:<br><br><div>void Session::release_tile(RenderTile& rtile)</div><div>{</div><div><span style="white-space:pre-wrap">        </span>thread_scoped_lock tile_lock(tile_mutex);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if(write_render_tile_cb) {</div><div><span style="white-space:pre-wrap">                </span>if(params.progressive_refine == false) {</div><div><span style="white-space:pre-wrap">                        </span>/* todo: optimize this by making it thread safe and removing lock */</div><div><span style="white-space:pre-wrap">                        </span>write_render_tile_cb(rtile);</div><div><br></div><div><span style="white-space:pre-wrap">                        //</span>delete rtile.buffers; // I commented this line!!</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>update_status_time();</div><div>}<br><br>with commenting delete rtile.buffers; , it doesn't crash, and updates fine!! "although with some problems in gamma in updating, but at the end the written image is gamma correct"<br><br>I'm not sure where is the problem.<br><br>cheers,<br>Mohamed Sakr</div></div></div></div></div>
<br></div></div>_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div><span style="color:rgb(102,102,102)">With best regards, Sergey Sharybin</span></div></div>
</font></span></div>
<br>_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><br></div>