cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

drallan
Challenger

How to lower OpenCL's high allocation of PC memory ?

I'm using almost all the 9GB of memory on 3 7970 cards. All the memory is allocated as GPU regular device buffers using only the CL_MEM_READ/WRITE flags, no PC memory or pointers are given to OCL. The application transfers relatively small amounts of data using simple clReadBuffer and clWriteBuffer calls, it does no mapping. The largest buffers are not accessed from the PC host.

However, OCL will not properly allocate the device memory unless I leave about the same 9GB of free available PC memory, which consumes much needed PC resources.

Is there any way (flag, setting, chant, etc) to prevent OCL from reserving so much PC memory?

AMD's Programming Guide mentions that OCL often needs to cache buffers in PC memory,

but there is no indication it would need to in this case.

Note:I use GPU_MAX_ALLOC_PERCENT=95 to fully allocate the device memory.

Many thanks.

0 Likes
4 Replies
prao
Staff
Staff

Re: How to lower OpenCL's high allocation of PC memory ?

Hi,

When you say its not properly allocating, whats actually happening? Is it a device allocation error? Can you also post the piece of code you are using?

Regards

Pradeep

0 Likes
tugrul_512bit
Adept III

Re: How to lower OpenCL's high allocation of PC memory ?

When I initiate a simple opencl raytracer algorithm on my HD7870, compiler uses about 6GB of system ram to compile while using mostly a few hundreds of MB on graphics card.

After compilation is done, system memory is released. When compiling for CPU(fx8150), no memory is needed at all for compiling.

0 Likes
amd_support
Staff
Staff

Re: How to lower OpenCL's high allocation of PC memory ?

hi drallan,

    I tried to observe it from our side, but I am not getting the same error.

    Could you please share your system configuration like

    a. The OS

    b. The device driver for GPU cards

    c. Host and device code.

Thanks,

AMD Support

0 Likes
amd_support
Staff
Staff

Re: How to lower OpenCL's high allocation of PC memory ?

Hi tugrul_512bit,

    Do you mean system ram is being used at compile time or run time? Compiler uses different paths for CPU and GPU code compilations so same behavior for CPU and GPU compilation can not be expected.

0 Likes