- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
We are trying to use Opencl with i5 6500.When we use clSVMAlloc() for SVM over a certain size,it will return failure.The questions as belows:
1. What factor decides the max SVM size ?(The size of host memory ? );
2.How does SVM work on physical storage?
3.How can I get the value of max SVM size on my platform?
regards.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For 32-bit applications total size available is 4GB due to the 32 bit address range size.
Whenever kernel using SVM allocation is being submitted to the GPU, whole SVM allocation needs to be resident at once, so it cannot be bigger then the total amount of host memory.
Maximal size of SVM allocation can be queried with
clGetDeviceInfo + CL_DEVICE_MAX_MEM_ALLOC_SIZE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Michal M. (Intel) wrote:
For 32-bit applications total size available is 4GB due to the 32 bit address range size.
Whenever kernel using SVM allocation is being submitted to the GPU, whole SVM allocation needs to be resident at once, so it cannot be bigger then the total amount of host memory.
Maximal size of SVM allocation can be queried with
clGetDeviceInfo + CL_DEVICE_MAX_MEM_ALLOC_SIZE
typedef struct rnamatrix{ int i; bool flag; } rnamatrix; rnamatrix * matrix_SVM_buffer; matrix_SVM_buffer=(rnamatrix*)clSVMAlloc(context,CL_MEM_READ_WRITE,rnalen*rnalen*sizeof(rnamatrix),0); if(matrix_SVM_buffer==NULL) { cout<<"clSVMAlloc() failure!\n"; }
My program is based on 64-bit and the system is also 64-bit. However,when I set rnalen=5200,the function of clSVMAlloc return NULL.When setting rnalen=4000,it will allocate successful.
I dont know why.Thank u for your attention.Looking forward to your reply.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you share more details :
- What Operating System is used?
- What does clGetDeviceInfo + CL_DEVICE_MAX_MEM_ALLOC_SIZE return ?
- What does clGetDeviceInfo + CL_DEVICE_GLOBAL_MEM_SIZE return ?
- What are clCreateContext parameters?
- Is it specific to CPU device , does the same problem reproduce on GPU device?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Michal M. (Intel) wrote:
Can you share more details :
- What Operating System is used?
- What does clGetDeviceInfo + CL_DEVICE_MAX_MEM_ALLOC_SIZE return ?
- What does clGetDeviceInfo + CL_DEVICE_GLOBAL_MEM_SIZE return ?
- What are clCreateContext parameters?
- Is it specific to CPU device , does the same problem reproduce on GPU device?
1.OS:Ubuntu 16.04LTS
2.Max memory allocation: 8397942784(7.821GiB)
3.Global memory size: 33591771136(31.28GiB)
4.context = clCreateContext( NULL,numDevices, devices, NULL, NULL, &status); PS:numDevices=2 and the devices array has two elements.
5.Yes
![](/skins/images/C4F7392A5C68ACA60290C9576F107044/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page