cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

omion
Journeyman III

Questions about OpenCL programming guide

Exact limits from section 4

In a number of places in the April 2011 version of the OpenCL programming guide there are references to "limited" memory, but I can't find anything saying exactly what those limits are.

1
4.4.1.3
The runtime allocates a limited amount of pinned host memory that is accessible by the GPU without using the CPU cache coherency protocol.


2
4.4.1.5
A limited portion of discrete GPU device memory is configured to be directly accessible by the CPU.


3
4.5.2.2
There is a limit on the maximum size per [zero-copy] buffer, as well as on the total size of all buffers. This is platform-dependent, limited in size for each buffer, and also for the total size of all buffers of that type (a good working assumption is 64 MB for the per-buffer limit, and 128 MB for the total).


I don't see anything about what those limits would depend on, or how to check what my system's limits are. 3 lists a "good working assumption" but it doesn't say why the limits would be any more or less than that.

Also, I haven't run into any actual limits on allocation testing out quotes 1 and 2. That leads me to believe that either the limits are larger than an allocatable buffer or that the system is silently using a different type of memory when those limits are reached.
Tags (2)
0 Likes
5 Replies
himanshu_gautam
Grandmaster

Questions about OpenCL programming guide

omion,

In case of pinned memory, memory used on RAM space by the buffer is not allowed to be swapped during the application runs. Large pinned buffers can severely limit the RAM which can be used for other purposes. Most OSes have their own threshold ram sizes which they can allot for pinned buffer(which might depend on many other parameters of system).

Refer to the Buffer Bandwidth Sample and check the size(possible) of buffers for your system by supplying different buffer sizes as input.

0 Likes
omion
Journeyman III

Questions about OpenCL programming guide

If there is not enough memory for pinned buffers, will the allocation fail or will it fall back to unpinned? For testing consistency, it would be nice to guarantee that the buffer is of a specific type.
0 Likes
himanshu_gautam
Grandmaster

Questions about OpenCL programming guide

AFAIK it falls to unpinned buffer.

0 Likes
omion
Journeyman III

Questions about OpenCL programming guide

Thanks for the answers!

Does anybody know about quote 2? That seems a bit different from OS-allocated RAM. I'd think that it would be up to the driver since the allocated memory is on the card.
0 Likes
himanshu_gautam
Grandmaster

Questions about OpenCL programming guide

Originally posted by: omion Thanks for the answers! Does anybody know about quote 2? That seems a bit different from OS-allocated RAM. I'd think that it would be up to the driver since the allocated memory is on the card.


The memory mentioned is a device memory which is mapped to RAM directly. CPU writes are extremely fast on this memory as write combine technique is used.

Refer to OpenCL Programming Guide for Details

0 Likes