I get the error CL_DEVICE_NOT_AVAILABLE
when running this sample code. However, unlike in that question, my CPU, the Intel Core 2 Duo E8500 CPU, appears to be supported. I've made sure to link against the Intel version of the OpenCL libraries, since I also have the Nvidia libraries installed. Why is this error occurring?
问题:
回答1:
"CL_DEVICE_NOT_AVAILABLE" has nothing to do with the SDK. It's due to the OpenCL device driver which is part of the video card device driver.
It's common to confuse the SDK and the OpenCL device driver. You develop the host code with the SDK but the kernel is compiled and run through the device driver. I often develop with the Intel SDK but I run my kernels on the CPU using the Intel video driver or the AMD Radeon drivers and on the GPU using the Nvidia video drivers (GTX590). I have all three video drivers installed in Windows. You don't have to have an AMD video card to instal the Radeon drivers.
So in your case you can use the AMD drivers to run your kernel on the CPU. They are much less restrictive than Intel's.
On windows I get faster results running my Kernel on my Sandy Bridge CPU using the Intel OpenCL drivers than AMD. However, on Linux the AMD driver runs my kernel faster on my Intel CPU than the Intel driver does.
回答2:
The Intel OpenCL SDK 2013 required SSE 4.2. From what I can tell (here) the Intel Core 2 Duo E8500 CPU only has SSE 4.1
"CL_DEVICE_NOT_AVAILABLE" is the error you get when you try to create an OpenCL device on an unsupported CPU.
The good news for you is that the Intel OpenCL SDK 2012 works on SSE 4.1; you should uninstall the 2013 SDK and use the 2012 SDK instead (or get a newer CPU).
回答3:
I encountered this error while creating a tutorial on how to install hashcat on Ubuntu 18.04; I've included the instructions below for Installing OpenCL™ Runtimes for Intel® Processors - Option A (Recommended)- feel free to review my full gist on GitHub. Hope that helps!
Installing OpenCL™ Runtimes for Intel® Processors
Installing OpenCL™ Runtimes for Intel® Processors - Option A (Recommended)
- Check your CPU system processor architecture by running
sudo lscpu
to identify the class of CPU e.g. "Intel (R) Core (TM) i7-7700 CPU @ 3.60Ghz"- alternatively, you can go to Settings > Details which will also reveal the CPU-family (e.g. Intel (R) HD Graphics 630 (Kaby Lake GT2)). - Go to the Intel Developer Zone and scroll down to the corresponding download link for your system; assuming you're running Ubuntu 18.04 and have a Intel Core-class CPU, scroll down to "Linux* OS Ubuntu* 16.04.x (deb)" and click on the Github link for 18.46.11837 Runtimes to access the runtime-packages to download.
- There should be instructions within the aforementioned Github repo- or you can proceed with the following in the next steps.
cd ~/Desktop
mkdir neo
cd neo
sudo wget https://github.com/intel/compute-runtime/releases/download/18.46.11837/intel-gmmlib_18.4.0.348_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/18.46.11837/intel-igc-core_18.44.1060_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/18.46.11837/intel-igc-opencl_18.44.1060_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/18.46.11837/intel-opencl_18.46.11837_amd64.deb
- Install the packages by running
sudo dpkg -i *.deb
. - Restart the system by running
sudo reboot
.
Installing OpenCL™ Runtimes for Intel® Processors - Option B
- Go to Intel OpenCL Runtimes website and scroll down to the bottom of the page to Download Intel CPU Runtime for OpenCL Applications 18.1 for LINUX OS (64-bit only).
- After downloading the OpenCL Runtimes for Intel Processors,
cd ~/Downloads
- Run
sudo tar -xzf l_opencl_p_18.1.0.013.tgz
to unpack the tgz file- please note, the OpenCL file version may update since the time as of this gist (ie as of this gist, the version is 18.1.0.013.) cd l_opencl_p_18.1.0.013
- Run
sudo ./install.sh
- A welcome screen is prompted- hold-down the "Enter" key until able to input select "2" for "I do NOT consent to the collection of my Information"
- Hit "1"
- Hit "1"
- Hit "Enter" and then restart the computer.
- If any additional Intel OpenCL errors are encountered after testing hashcat, go to section 'Installing OpenCL™ Runtimes for Intel® Processors - B'- if not, proceed with section "Testing Hashcat"