can I use pinned memory?

Hi All,

I have installed CUDA 2.3 driver , toolkit and SDK and i want to use pinned memory but when I see the cudaDeviceProp structure then one of its member value is

canMapHostMemory 1 .

I want to know what this value indicates?

I think it indicates this property is on .

Hi ,

I have written code for using pinned memory :-

In my case :

dstSize = 17280000

      flag      = 2 ( cudaHostAllocMapped )

But after executing the line

I got error cudaErrorUnknown .

can any one help on this ?

I have seen SDK 2.3 project simpleZeroCopy code and I try to implement it in my code. But I have some confusion on using it.

Is following code should be only on main function or I can write it in any function :

Because if I write it on main function then it works fine but if I write it any other function then it gives error. Please help…

This problem is solved . We can write it any function . Actually I got this error because of prior error.

And what was your error?

I got also a “cudaErrorUnknown” when I try to allocate pinned memory with cudaHostAlloc().


Make sure you’re first calling: