Skip to content
New issue

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

Synchronization problems between Vulkan and CUDA #2

Open
antaalt opened this issue Mar 9, 2020 · 2 comments
Open

Synchronization problems between Vulkan and CUDA #2

antaalt opened this issue Mar 9, 2020 · 2 comments

Comments

@antaalt
Copy link

antaalt commented Mar 9, 2020

I think there might be synchronization issues with the denoiser between CUDA and Vulkan. The denoiser is run once per frame after raytracing the image, and before tonemapping it.

But the command buffer is being built then submitted to the graphics queue while the optix denoiser is run immediatly while building command buffer and it waits for completion with cudaStreamSynchronize. Which means that each frame, the denoiser will denoise the previous frame instead of the one that was just processed, as the command buffer is not submitted yet. The first frame will then be an undefined output.

Is this an intended features ?

@wumo
Copy link

wumo commented Jun 29, 2020

Yeah. also interested in how optix syncs with vulkan.

@antaalt
Copy link
Author

antaalt commented Jun 29, 2020

I managed to fix this by using external semaphore to sync vulkan command buffers with cuda streams used by the optix 7 denoiser. There is a good example in the CUDA SDK for synchronization between Cuda and Vulkan here vulkanCUDASinewave.cu. This way, you can wait for a semaphore to be signaled by a vulkan command buffer before running the Cuda stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants