Buffer trouble with TonemapperSimple
Hi, I have some troubles getting the tonemapper to work. I have 2 simple buffers and a single tonemapper: [code]optix::Buffer InputBuffer = context->createBuffer(RT_BUFFER_INPUT, RT_FORMAT_FLOAT4, width, height); optix::Buffer OutputBuffer = context->createBuffer(RT_BUFFER_OUTPUT, RT_FORMAT_FLOAT4, width, height); optix::PostprocessingStage inTonemapStage = context->createBuiltinPostProcessingStage("TonemapperSimple"); inTonemapStage->declareVariable("input_buffer")->set(InputBuffer); inTonemapStage->declareVariable("output_buffer")->set(OutputBuffer); optix::CommandList cmdList = context->createCommandList(); cmdList->appendPostprocessingStage(inTonemapStage, width, height); cmdList->finalize(); ...inputbuffer.map() ... unmap() ... cmdList->execute();[/code] At runtime I get this in the execute(): [code](Details: Function "_rtCommandListExecute" caught exception: Assertion failed: "!( pinnedDevice & buf->m_allocatedSet ).empty() : Trying to pin buffer to device without allocation", file: C:\u\workspace\rel5.0-win64-cuda90-VS2015-build-Release\sw\wsapps\raytracing\rtsdk\rel5.0\src\Memory\MemoryManager.cpp, line: 742)'[/code] If I use the denoiser instead of the tonemapper it works fine. So what am I missing for the tonemapper to work? The denoiser example does not look much different in the buffers. The only difference is the raytracing stage in front of the tonemapper. Thanks, Nico
Hi,
I have some troubles getting the tonemapper to work. I have 2 simple buffers and a single tonemapper:


optix::Buffer InputBuffer = context->createBuffer(RT_BUFFER_INPUT, RT_FORMAT_FLOAT4, width, height);
optix::Buffer OutputBuffer = context->createBuffer(RT_BUFFER_OUTPUT, RT_FORMAT_FLOAT4, width, height);
optix::PostprocessingStage inTonemapStage = context->createBuiltinPostProcessingStage("TonemapperSimple");
inTonemapStage->declareVariable("input_buffer")->set(InputBuffer);
inTonemapStage->declareVariable("output_buffer")->set(OutputBuffer);
optix::CommandList cmdList = context->createCommandList();
cmdList->appendPostprocessingStage(inTonemapStage, width, height);
cmdList->finalize();
...inputbuffer.map() ... unmap() ...
cmdList->execute();


At runtime I get this in the execute():
(Details: Function "_rtCommandListExecute" caught exception: Assertion failed: "!( pinnedDevice & buf->m_allocatedSet ).empty() : Trying to pin buffer to device without allocation", file: C:\u\workspace\rel5.0-win64-cuda90-VS2015-build-Release\sw\wsapps\raytracing\rtsdk\rel5.0\src\Memory\MemoryManager.cpp, line: 742)'


If I use the denoiser instead of the tonemapper it works fine. So what am I missing for the tonemapper to work? The denoiser example does not look much different in the buffers. The only difference is the raytracing stage in front of the tonemapper.

Thanks,
Nico

#1
Posted 01/08/2018 08:38 PM   
I am guessing you are running on dual GPU? Does the error go away if you restrict to a single device (eg, via CUDA_VISIBLE_DEVICES=1 env var)?
I am guessing you are running on dual GPU? Does the error go away if you restrict to a single device (eg, via CUDA_VISIBLE_DEVICES=1 env var)?

#2
Posted 01/09/2018 03:48 PM   
in the original Denoiser sample there's also a version without denoiser "commandListWithoutDenoiser", but with pure tone mapper. That one is always executed for all "early frames". Try to simply use that. In your code above there's also this line missing: commandListWithoutDenoiser->appendLaunch(0, width, height);
in the original Denoiser sample there's also a version without denoiser "commandListWithoutDenoiser", but with pure tone mapper. That one is always executed for all "early frames". Try to simply use that.
In your code above there's also this line missing:
commandListWithoutDenoiser->appendLaunch(0, width, height);

Disclaimer: No warranty. No legal advice.

#3
Posted 01/09/2018 08:53 PM   
Hi, thanks for the input. Although I do use a laptop with integrated + dedicated card setting CUDA_VISIBLE_DEVICES doesn't help. And as I said, the other postprocessing stage works, the denoiser example from the sdk too. commandListWithoutDenoiser->appendLaunch(0, width, height); would only work if I have a rendering kernel before denoising, but I fill the buffer from an external source, so that shouldn't be the issue. I really looked at the sdk example and the only difference I can see is that I don't have a rendering kernel .. I directly fill the buffer from an image.
Hi,

thanks for the input. Although I do use a laptop with integrated + dedicated card setting CUDA_VISIBLE_DEVICES doesn't help. And as I said, the other postprocessing stage works, the denoiser example from the sdk too.

commandListWithoutDenoiser->appendLaunch(0, width, height); would only work if I have a rendering kernel before denoising, but I fill the buffer from an external source, so that shouldn't be the issue. I really looked at the sdk example and the only difference I can see is that I don't have a rendering kernel .. I directly fill the buffer from an image.

#4
Posted 01/10/2018 07:54 AM   
I've reproduced the behavior by pruning down the optixDenoiser example and filed a bug report against OptiX. You can workaround the problem temporarily by appending a launch of an empty ray generation program to the command list before the tonemapper stage.
I've reproduced the behavior by pruning down the optixDenoiser example and filed a bug report against OptiX.

You can workaround the problem temporarily by appending a launch of an empty ray generation program to the command list before the tonemapper stage.

#5
Posted 01/11/2018 02:26 PM   
Thanks for checking and confirming my suspicion. Nico
Thanks for checking and confirming my suspicion.

Nico

#6
Posted 01/11/2018 07:14 PM   
Scroll To Top

Add Reply