<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Brecht,&nbsp;<div><br></div><div>Thanks for looking into this. This is actually an error introduced by myself. I was trying to get familiar with cycles code by playing with it and I added these three lines to&nbsp;void Session::update_status_time(bool show_pause, bool show_done) function:</div><div>tonemap();<br>progress.set_status("Writing Image", params.output_path);<br>display-&gt;write(device, params.output_path);<br>which now I understand are not supposed to be there.&nbsp;</div><div><br></div><div>I have one question though. I would like to be able to save the rendered image from cycles_standalone without invoking the GUI. However, the only function I can find for doing that is display-&gt;write(). I think display is a null object if cycles_standalone is run in background mode. So how do we save an image in background mode?</div><div><br></div><div>Thanks a lot,</div><div>Feng</div><div><br></div><div><br></div><div><br><div>&gt; From: brechtvanlommel@pandora.be<br>&gt; Date: Fri, 21 Feb 2014 15:42:04 +0100<br>&gt; To: bf-cycles@blender.org<br>&gt; Subject: Re: [Bf-cycles] CUDA error with Cycles_standalone<br>&gt; <br>&gt; Hi,<br>&gt; <br>&gt; I couldn't reproduce this problem on Mac OS X, I'm not sure what is<br>&gt; going on. Perhaps your graphics card doesn't support an OpenGL feature<br>&gt; that we use, but even then it's not clear to me why it would give this<br>&gt; error.<br>&gt; <br>&gt; Which graphics card(s) do you have?<br>&gt; <br>&gt; Brecht.<br>&gt; <br>&gt; On Wed, Feb 19, 2014 at 12:05 AM, Zhanpeng Feng &lt;jumpjump88@hotmail.com&gt; wrote:<br>&gt; &gt; Hi,<br>&gt; &gt;<br>&gt; &gt; I was trying to use the cycles_standalone and and got the following error. I<br>&gt; &gt; am wondering if anyone has seen similar issues?<br>&gt; &gt; Error message:<br>&gt; &gt; D:\blenderSVN_2\cmake-build\bin\Debug&gt;cycles --device cuda --samples 10<br>&gt; &gt; monkeyte<br>&gt; &gt; st.xml --output this.bmp<br>&gt; &gt; CUDA error: Invalid context in cuGraphicsMapResources(1,<br>&gt; &gt; &amp;pmem.cuPBOresource, 0)<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Refer to the Cycles GPU rendering documentation for possible solutions:<br>&gt; &gt; http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/GPU_Rendering<br>&gt; &gt;<br>&gt; &gt; CUDA error: Not mapped in cuGraphicsResourceGetMappedPointer(&amp;buffer,<br>&gt; &gt; &amp;bytes, pm<br>&gt; &gt; em.cuPBOresource)<br>&gt; &gt; CUDA error: Not mapped in cuGraphicsUnmapResources(1, &amp;pmem.cuPBOresource,<br>&gt; &gt; 0)<br>&gt; &gt; CUDA error: Launch failed in cuCtxSynchronize()<br>&gt; &gt;<br>&gt; &gt; In the cycles standalone GUI I am able to see the rendering progresses and<br>&gt; &gt; the scene is actually being rendered fine. No error occurs until tonemap()<br>&gt; &gt; is called in the<br>&gt; &gt; void Session::update_status_time(bool show_pause, bool show_done) function<br>&gt; &gt; of session.cpp<br>&gt; &gt; else if(show_done) {<br>&gt; &gt; status = "Done";<br>&gt; &gt; tonemap();<br>&gt; &gt; progress.set_status("Writing Image", params.output_path);<br>&gt; &gt; display-&gt;write(device, params.output_path);<br>&gt; &gt; }<br>&gt; &gt; If I run it using --device cpu everything works fine.<br>&gt; &gt; Any help is appreciated.<br>&gt; &gt;<br>&gt; &gt; Thanks a lot,<br>&gt; &gt; Feng<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Bf-cycles mailing list<br>&gt; &gt; Bf-cycles@blender.org<br>&gt; &gt; http://lists.blender.org/mailman/listinfo/bf-cycles<br>&gt; &gt;<br>&gt; _______________________________________________<br>&gt; Bf-cycles mailing list<br>&gt; Bf-cycles@blender.org<br>&gt; http://lists.blender.org/mailman/listinfo/bf-cycles<br></div></div>                                               </div></body>
</html>