cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Fr4nz
Journeyman III

clGetDeviceInfo with CL_DEVICE_GLOBAL_MEM_SIZE is not reporting the correct amount of memory!

Hello, I'm working under Ubuntu 9.04 with an ATI 5770 with 1GB of RAM and the latest atistream 2.0 (downloaded today).

Everything seems to work fine for now, although the instruction:

errorCode = clGetDeviceInfo(devices[0],CL_DEVICE_GLOBAL_MEM_SIZE,sizeof(cl_ulong),sizeMemGlob,NULL);


returns an amount of memory equal to "268435456 bytes", which is clearly not correct (it is exactly 1/4th of the real memory). The same amount of memory is returned when we use the constant CL_DEVICE_MAX_MEM_ALLOC_SIZE, which is correct as it must report 1/4th of the total amount (as stated by OpenCL specs).

So my question is: is it a bug or the result given when we use the constant CL_DEVICE_GLOBAL_MEM_SIZE is intended to be 1/4th of the total memory? It doesn't sound correct to me...

PS: Also beta4 seems to be affected by this bug.

0 Likes
6 Replies
jcpalmer
Adept I

You have a misconception of what the API call is returning.  It is not supposed to return the total amount of memory, just amount that opencl contexts can use for global access.  This is actually much more useful.  

The minimum value for this is 1/4 total memory, I believe. Remember implementing OpenCL, your kernels, etc have to be stored somewhere.

0 Likes

Originally posted by: jcpalmer You have a misconception of what the API call is returning.  It is not supposed to return the total amount of memory, just amount that opencl contexts can use for global access.  This is actually much more useful.  

 

The minimum value for this is 1/4 total memory, I believe. Remember implementing OpenCL, your kernels, etc have to be stored somewhere.

 

OpenCL specs says:

  • (page 36) CL_DEVICE_GLOBAL_MEM_SIZE: size of global memory device in bytes;
  • (page 34) CL_DEVICE_MAX_MEM_ALLOC_SIZE:  Max size of memory object allocation in bytes; The minimum value is max 1/4th of CL_DEVICE_GLOBAL_MEM_SIZE;

so, I think I've read and interpreted correctly the specs

Conclusion: clGetDeviceInfo should return 2 different values with those two constants, this is the point...

0 Likes
Stib
Journeyman III

I can only say, that for me, on my EAH4850 it works as is should.

0 Likes

Your right, my mess up (missed reading a line).  At least they "picked" the value to be wrong that is of little consequence.  The one that has to be right is the alloc size.  The total memory size is mostly just a stat. 

0 Likes

Originally posted by: jcpalmer Your right, my mess up (missed reading a line).  At least they "picked" the value to be wrong that is of little consequence.  The one that has to be right is the alloc size.  The total memory size is mostly just a stat. 

 

 

@jcpalmer: I agree with you jc, it is only a little bug at the end (anyway it should be simple to fix)

@stib: So it is possibile that this bug affects only certain videocards...

0 Likes
Stib
Journeyman III

I installed the new version of the SDK, and i get now false reading too. It had worked earlier.

0 Likes