Hello, I am confused now because of an error in my OPTIX code.
My code launchs rays using optixLaunch function below.
OPTIX_ERROR_CHECK(optixLaunch(pipeline, cudaStream, (CUdeviceptr)launchParamsBuffer, (size_t)(sizeof(launchParams)), &sbt, launchWidth, 1, 1));
This optixLaunch function figures out and stores information on whether some rays hit any mesh in the device memory.
And after optixLaunch function is finished, this information in the device memory is delivered to the host memory by cudaMemcpy function below.
CUDA_ERROR_CHECK(cudaMemcpy(reinterpret_cast<void>(hostPointer), reinterpret_cast<void>(launchParams.devicePointer), deviceMemorySize * sizeof(bool), cudaMemcpyDeviceToHost));**
This works well for a small number of launchWidth.
However, when the launchWidth becomes larger than about 500 million, the cudaMemcpy function show me an error: FATAL ERROR: An CUDA error has occurredcudaErrorIllegalAddress: an illegal memory access was encountered
Furthermore, after optixLaunch function is finished, not only cudaMemcpy function that transfers device memories written by the optixLaunch function, but also any other cudaMemcpy function that transfers memories irrelevant with optixLaunch function show me the same error.
It seems like the optixLaunch function destroys the whole device memory.
I recognize that the maximum number of launchWidth is 2^30, so I thought 500 million launchWidth should work well.
Could you give me any advice on this problem?
P.S. I am using RTX A6000 GPU and the device memory is sufficient.