We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I was wondering if you free pDevScene etc. in your rendering call or if it is already reimplemented otherwise. Regardless, my code looks something like this: And I found that no dev pointer gets freed, which after several thousand iteration fills up the gpu memory to the brim. best regards Christoph void Render(const int& Type, CScene& Scene, CTiming& RenderImageTimer, CTiming& BlurImageTimer, CTiming& PostProcessImageTimer, CTiming& DenoiseImageTimer) { CScene* pDevScene = NULL; HandleCudaError(cudaMalloc(&pDevScene, sizeof(CScene)), "alloc dev scene failed"); HandleCudaError(cudaMemcpy(pDevScene, &Scene, sizeof(CScene), cudaMemcpyHostToDevice)); if (Scene.m_Camera.m_Focus.m_Type == 0) Scene.m_Camera.m_Focus.m_FocalDistance = NearestIntersection(pDevScene); HandleCudaError(cudaMemcpy(pDevScene, &Scene, sizeof(CScene), cudaMemcpyHostToDevice)); CCudaView* pDevView = NULL; HandleCudaError(cudaMalloc(&pDevView, sizeof(CCudaView))); HandleCudaError(cudaMemcpy(pDevView, &gRenderCanvasView, sizeof(CCudaView), cudaMemcpyHostToDevice)); CCudaInstantRadiosity* pDevIR= NULL; HandleCudaError(cudaMalloc(&pDevIR, sizeof(CCudaInstantRadiosity))); HandleCudaError(cudaMemcpy(pDevIR, &gInstantRadiosity, sizeof(CCudaInstantRadiosity), cudaMemcpyHostToDevice)); CCudaTimer TmrRender; bool VPLRender = true; switch (VPLRender) { case false: { SingleScattering(&Scene, pDevScene, pDevView); break; } case true: { RenderVPL(&Scene, pDevScene, pDevIR, gpVPLArray, gpAVSMArray, pDevView); break; } } HandleCudaError(cudaFree(pDevIR),"Error freeing pDevIR"); RenderImageTimer.AddDuration(TmrRender.ElapsedTime()); CCudaTimer TmrBlur; Blur(&Scene, pDevScene, pDevView); BlurImageTimer.AddDuration(TmrBlur.ElapsedTime()); CCudaTimer TmrPostProcess; Estimate(&Scene, pDevScene, pDevView); PostProcessImageTimer.AddDuration(TmrPostProcess.ElapsedTime()); ToneMap(&Scene, pDevScene, pDevView); CCudaTimer TmrDenoise; Denoise(&Scene, pDevScene, pDevView); DenoiseImageTimer.AddDuration(TmrDenoise.ElapsedTime()); HandleCudaError(cudaFree(pDevView),"Error freeing pDevView"); HandleCudaError(cudaFree(pDevScene),"Error freeing pDevScene"); }
Original issue reported on code.google.com by [email protected] on 10 Aug 2012 at 1:07
[email protected]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Original issue reported on code.google.com by
[email protected]
on 10 Aug 2012 at 1:07The text was updated successfully, but these errors were encountered: