开发者

Where can I find information about the Unified Virtual Addressing in CUDA 4.0?

开发者 https://www.devze.com 2023-02-15 16:09 出处:网络
Where can I find information / changesets / suggestions for using the new enhancements in CUDA 4.0?I\'m especially interested in 开发者_如何学Golearning about Unified Virtual Addressing?

Where can I find information / changesets / suggestions for using the new enhancements in CUDA 4.0? I'm especially interested in 开发者_如何学Golearning about Unified Virtual Addressing?

Note: I would really like to see an example were we can access the RAM directly from the GPU.


Yes, using host memory (if that is what you mean by RAM) will most likely slow your program down, because transfers to/from the GPU take some time and are limited by RAM and PCI bus transfer rates. Try to keep everything in GPU memory. Upload once, execute kernel(s), download once. If you need anything more complicated try to use asynchronous memory transfers with streams.

As far as I know "Unified Virtual Addressing" is really more about using multiple devices, abstracting from explicit memory management. Think of it as a single virtual GPU, everything else still valid.

Using host memory automatically is already possible with device-mapped-memory. See cudaMalloc* in the reference manual found at the nvidia cuda website.


CUDA 4.0 UVA (Unified Virtual Address) does not help you in accessing the main memory from the CUDA threads. As in the previous versions of CUDA, you still have to map the main memory using CUDA API for direct access from GPU threads, but it will slow down the performance as mentioned above. Similarly, you cannot access GPU device memory from CPU thread just by dereferencing the pointer to the device memory. UVA only guarantees that the address spaces do not overlap across multiple devices (including CPU memory), and does not provide coherent accessibility.

0

精彩评论

暂无评论...
验证码 换一张
取 消