I first installed the OpenCL 1.2 Driver (intel-opencl-1.2-devel-1.0-47971.x86_64) for Intel HD graphics on my Ubuntu box (involving patching and installing Linux kernel 4.1), downloaded from the following link
once the GPU driver is installed, my OpenCL code (https://github.com/fangq/mcxcl) can list and run my simulation on the HD 5500 GPU (speed =1200 photon/ms).
After I succeeded this step, I installed the Intel OpenCL CPU driver (opencl-1.2-sdk-18.104.22.168), with a hope that I can run my code on either device by a switch, or both simultaneously (I use "-G" and a 0-1 mask to select active devices).
However, after both drivers are installed, I no longer be able to run my code on the GPU.
When I list all available devices (mcxcl -L), I get the following output, there are 3, and 2 devices referred to the same CPU (i7-5600U):
Platform  Name Intel(R) OpenCL devnum=1 ============ CPU device ID 1 [1 of 1]: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz ============ Compute units : 4 core(s) Global memory : 8245342208 B Local memory : 32768 B Constant memory : 131072 B Clock speed : 2600 MHz Platform  Name Intel(R) OpenCL devnum=1 ============ GPU device ID 2 [1 of 1]: Intel(R) HD Graphics ============ Compute units : 23 core(s) Global memory : 6587885159 B Local memory : 65536 B Constant memory : 1646971289 B Clock speed : 950 MHz devnum=1 ============ CPU device ID 3 [1 of 1]: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz ============ Compute units : 4 core(s) Global memory : 8245342208 B Local memory : 32768 B Constant memory : 131072 B Clock speed : 2600 MHz
Now, when I run the code on the CPU using -G 100, it runs successfully. However, when I try to run the code on the GPU device (-G 010), I got thousands lines of compilation error that was not the case previously.
Kernel build error: In file included from <built-in>:138: In file included from <command line>:18: CTHeader.h:127:69: error: unknown type name 'uchar'; did you mean 'char'? CTHeader.h:127:96: error: unknown type name 'uchar'; did you mean 'char'? CTHeader.h:129:69: error: unknown type name 'ushort'; did you mean 'short'? CTHeader.h:129:97: error: unknown type name 'ushort'; did you mean 'short'? ....
when I run the code on the 3rd device (-G 001), I got another error
Kernel build error: Compilation started Compilation done Linking started Linking done Device build started Device build done Kernel <mcx_main_loop> was successfully vectorized (8) Done. MCX ERROR(11):Error: Failed to build program executable! in unit mcx_host.cpp:375
so my question for you all, can I actually use both CPU and GPU drivers together? why my GPU target stopped running after I installed the CPU driver?
any suggestions would be appreciated.
One of our engineers tried the following procedure. These steps assume Ubuntu 14.04 with no OpenCL IDCs previously installed on the system.
Ubuntu isn't an officially supported OS. Source is provided for opensource components so that you can modify in any way you like, but our ability to support is limited. Neither Ubuntu nor the following method is supported or validated by Intel. There may be steps missing or details about your system that aren't taken into account. However, we hope that the information is helpful.
Download OpenCL™ Driver for Intel® HD Graphics for Linux* (64-bit) as part of Intel® Media Server Studio.
Download the community edition of Intel® Media Server Studio 2016
# Required dependencies $ sudo apt-get install libpciaccess-dev $ sudo apt-get install libnuma-dev # Extract the package contents $ tar -zxf intel-opencl-1.2-1.0-47971.tar.gz $ tar -zxf MediaServerStudioEssentials2016.tar.gz # Extract the Media SSE SDK $ tar -zxf MediaServerStudioEssentials2016/SDK2016Production16.4.4.tar.gz # Extract the CPU OCL implementation $ tar -ztf SDK2016Production16.4.4/Generic/intel-linux-media-ocl_generic_16.4.4-47109_64bit.tar.gz # Remove the OpenCL vendor configuration and other files related to Media SDK $ rm -rf etc # Remove the previous GPU OCL implementation $ rm opt/intel/opencl/libIntelOpenCL.so* $ rm opt/intel/opencl/libOpenCL.so* $ rm opt/intel/opencl/libigdbcl.so.16* $ rm opt/intel/opencl/libigdfcl.so.16* $ rm opt/intel/opencl/libigdmcl.so.16* $ rm opt/intel/opencl/libigdrcl.so.16* # Extract the OCL ICD, GPU OCL implementation and OCL headers into the Media SDK area $ tar -zxf intel-opencl-1.2-1.0-47971/intel-opencl-1.2-1.0-47971.x86_64.tar.gz $ tar -zxf intel-opencl-1.2-1.0-47971/intel-opencl-1.2-devel-1.0-47971.x86_64.tar.gz # Remove any previous OpenCL solutions from Intel $ sudo rm -rf /opt/intel/opencl # Copy $ sudo cp -R etc / $ sudo mkdir -p /opt/intel/opencl $ sudo cp -R opt/intel/opencl /opt/intel $ sudo ldconfig # Verify user is in the same group (video) as the GPU device $ ls -al /dev/dri/ $ groups # Adjust user as needed