OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

clCreateContext never finishes

cnugteren
Beginner
593 Views
The problem I'm having with running OpenCL code on an Intel CPU using Intel's SDK on Linux is the following:

My code often hangs at the call to 'clCreateContext'. This means it never returns and thus also not return any error code. It uses 120% CPU according to the information provided by 'top'. I've tried numerous things, but the only solution so far is to kill the process and try again. The call to 'clCreateContext' works fine say ~75% of the time, but hangs the other ~25%. If it works fine, then my whole program exectutes fine.

I don't think the actual algorithm I want to execute is very relevant, because the same problem occurs for other examples as well. Anyhow, I've attached the code, because maybe I'm doing something wrong at initialisation. If the code hangs, it hangs at the first call to 'clCreateContext' (line 118 of saxpy_host.c), the second call (line 164) always works fine.

I'm running on the following system:
  • OS: Ubuntu 12.04 server
  • Intel Core i7-3770 (target for OpenCL code - The CPU, not the GPU)
  • Intel SDK OpenCL 2012(target for OpenCL code)
  • AMD 7950 (running X server, not used in this case)
  • AMD APP SDK 2.7 (not used in this case, but still installed)
  • No screens attached (not to the AMD GPU, not to the Intel integrated GPU)

Things I've tried:
  • Re-install the Intel SDK (using Alien).
  • Use 'clCreateContextFromType' instead of 'clCreateContext'
  • Tried to use a callback function 'pfn_notify', but it never prints anything.
  • Test without actual execution of the kernel

Due to the random nature of the problem, I'm not sure what to do next. Any suggestions for anything I should try?
0 Kudos
3 Replies
Raghupathi_M_Intel
593 Views
Hi,

Thanks for the test case. We'll investigate this and get back to you.

Raghu

0 Kudos
cnugteren
Beginner
593 Views
Thank you, that is very much appreciated. If you need any further information on my system/configuration, please let me know.
By the way, I ran a Memtest86+ on the system (since it is a newly configured system, and since the 'clCreateContext' calls sometimes do and sometimes don't work), but the memory appears to be intact.
0 Kudos
cnugteren
Beginner
593 Views
Hello again.
For some reason, the problem is gone now. I'm not sure what exactly. However, a few things have changed in the meantime to the code. Attached you will find the new version of the code, which does not give any problems.The new version of the code (it's generated code) now has global variables for context, queue and program.
Anyway, my problem is solved, and apparently nobody else experienced this problem.
0 Kudos
Reply