GPU Compute Software
Ask questions about Intel® Graphics Compute software technologies, such as OpenCL* GPU driver and oneAPI Level Zero
140 Discussions

How to setup OpenCL in Cygwin for Intel GPU

Tahirazemgrm
Beginner
2,907 Views

I have a Laptop with Intel(R) HD Graphic 520 GPU in it. It added OpenCL developer Packages to Cygwin. I have found a small Mandelbrot-Set calculator program for OpenCL in C on Github. It is for Apple, so I modified the Makefile to use the proper headers and settings for gcc. Now the code compiles and executes nicely (bmp file created):

 

$ ./mandelbrot.exe
Device 0: GenuineIntel pthread-Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
I have two questions:

 

#1. How can I add (if it is possible) the Intel GPU to the /etc/OpenCL/vendors list? I tried to install from Intel site the Intel CPU runtime for OpenCL Applications for Windows OS and Intel Graphics Technology driver package, but I do not know where can I find the proper OpenCL dll I can point in the intel.idc file.

 

#2. In /etc/OpenCL/vendors I have found a pocl.icd file pointing to cygpocl-2.dll. I assume this is the pthread library. But it seems to me it is running only a single thread, although I have 4 cores. Should I do any modification to run it in multiple threads? I debugged the code and it seems that as there are only one device found, so it runs only on one thread. In the initialization function it sets the device work_size property for processing a stirp per device of the final bmp. But as there is only one device, the whole bmp is processed by one run (one clEnqueueNDRangeKernel and one clEnqueueReadBuffer is called).

0 Kudos
3 Replies
Anita_Intel
Employee
2,651 Views

To compile and run OpenCL programs in Cygwin:

  1. Ensure that you have the latest GPU driver by installing from https://www.intel.in/content/www/in/en/support/intel-driver-support-assistant.html
  2. Install OpenCL header and Library from Khronos OpenCL Registry - The Khronos Group Inc or from Intel OpenCL SDK Choose & Download Intel® SDK for OpenCL™ Applications  , if you have not already done so.
  3. Install libOpenCL1 cygwin package via Cygwin Package Manager Cygwin Installation
  4. Replace the cygwin's OpenCL library with the DLL from Intel (Copy as below)
  5. Copy file "/cygdrive/c/Windows/System32/OpenCl.dll" to directory "/cygdrive/c/cygwin64/bin/" and alter it as "/cygdrive/c/cygwin64/bin/cygOpenCL-1.dll"  (You can save old dll as  "/cygdrive/c/cygwin64/bin/cygOpenCL-1-old.dll")
  6. Ensure that “/etc/OpenCL/vendors/intel.icd” points to “cygOpenCL-1.dll”
  7. Recompile and run your OpenCL program for GPU.

 

Please try this and share your results.

 

Thanks,

Anita

 

0 Kudos
Anita_Intel
Employee
2,590 Views

Hi Tahir Azemgrm,


I am checking to see whether you are now able to access the GPU in Cygwin.


Thanks


0 Kudos
Anita_Intel
Employee
2,572 Views

Hi,


We have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks & Regards,

Anita


0 Kudos
Reply