English 中文(简体)
CUDA host to device (or device to host) memcpy operations with application rendering graphics using OpenGL on the same graphics card
原标题:
  • 时间:2009-11-07 21:52:13
  •  标签:
  • cuda
  • memcpy

I have posted my problem in the CUDA forums, but not sure if it s appropriate to post a link here for more ideas in case there are significant number of different audiences between the two forums. The link is here. I apologize for any inconvenience and appreciate any comments on this question, as I haven t heard back yet on some specifics of a particular CUDA memory access and management problems. Thanks in advance.

最佳回答

I m not sure if this is relevant without seeing more of your code but where is CudaObj s destructor being called from?

you said:

However, if I do it this way, I run into errors exiting the application in the line of CudaObj s destructor where cudaFree() is called. This causes the memory cleanup code after CUDA context s cleanup code not being executed due to the error, leaving behind a mess of memory leaks.

After your description of how you changed the cuda setup stuff to be in the beginning of thread2 s main function. If you re calling the destructor on CudaObj from a different thread then doing the cudaFree cleanup will be in error for the same reason that you had to move the cuda initialization into thread 2. It sounds like you know this already, but the cuda context is specific to a single thread in your process. Cleaning up in a different thread is not supported according to the documentation, though I ve never tried it myself. Hope this helps

问题回答

暂无回答




相关问题
Why won t OpenCV compile in NVCC?

I am trying to integrate CUDA and openCV in a project. Problem is openCV won t compile when NVCC is used, while a normal c++ project compiles just fine. This seems odd to me, as I thought NVCC ...

error in CUDA compilation

I m getting this error while trying to run sample codes in CUDA SDK. I have CUDA 2.3 and Visual studio 2008 LINK : fatal error LNK1181: cannot open input file cutil32D.lib Any pointers how to ...

CUDA Memory Allocation accessible for both host and device

I m trying to figure out a way to allocate a block of memory that is accessible by both the host (CPU) and device (GPU). Other than using cudaHostAlloc() function to allocate page-locked memory that ...

热门标签