I am currently trying to load memory from an NVMM buffer into a Vulkan Storage Image.
From what I have gathered so far, this is possible to do and I have gone through the CUDA reference manual (1. Introduction — CUDA C Programming Guide), where it is exemplified how it is done.
However I have some doubts.
- Is importing the NVMM buffer pointer into a cudaImportExternalMemory and subsequently mapping the buffer using cudaExternalMemoryGetMappedBuffer enough to modify the resulting buffer pointer:
checkCudaErrors(cudaImportExternalMemory(&cudaExtMemImageBuffer, &cudaExtMemHandleDesc)); ... ... void* buff = nullptr; checkCudaErrors(cudaExternalMemoryGetMappedBuffer(&buff, cudaExtMemImageBuffer, &desc)); checkCudaErrors(cudaMemcpy(buff, surface_params->dataPtr, desc.size, cudaMemcpyDeviceToDevice));
i.e Should the cudaMemCpy immediately updated the VkImage
Does the size I set in the cudaExternalMemoryBufferDesc reflect the actual size of the VkImage in bytes or something else.
Is any of the mipmapping section of the documentation necessary in order for a successful memory copy to occur.
I understand these questions may have obvious answers, but I would greatly appreciate a hint towards the right direction.
Thank you for your time,