SysAdmin‎ > ‎

OpenCL for CPU and MIC


  • Downloaded opencl_runtime_16.1_x64_ubuntu_5.2.0.10002.tgz from (stored in ~egallicchio/Dropbox/src/)
  • Extracted and launched install program (opens graphical window)
  • Asked to install lsb-core: sudo apt-get install lsb-core
  • Checked that /etc/OpenCL/vendors/ contains links to CUDA/OpenCL and Intel CPU versions
  • Installed generic OpenCL headers: sudo apt-get install opencl-headers
  • Compiled attached test program: g++ -o OpenCLQuery -I/opt/intel/opencl-1.2-3.0.67279/include OpenCLQuery.cpp -lOpenCL
  • Output shows two platforms named: "Intel(R) OpenCL" and "NVIDIA CUDA". 

CentOS (forio)

  • Downloaded opencl_runtime_14.2_x64_4.5.0.8.tgz  from (stored in ~egallicchio/Dropbox/src/)
  • Extracted and launched text-based install program
  • Installed for both the MIC and the CPU
  • Compiled attached test program: g++ -o OpenCLQuery -I/usr/local/cuda/include OpenCLQuery.cpp -lOpenCL
  • Output shows two platforms named: "Intel(R) OpenCL" and "NVIDIA CUDA".

    OpenMM notes

    • Platform can be selected using the ""OpenCLPlatformIndex"  property of the OpenMM platform. "OpenCLDeviceIndex" gives additional selection capability. For example the following selects the CPU device of forio. (Platform "0", device "1" turns out to be the MIC. And platform "1" is the GPU.)
    platform = Platform.getPlatformByName('OpenCL')
    prop = {"OpenCLPrecision" : "single", "OpenCLPlatformIndex" : "0", "OpenCLDeviceIndex": "0"};
    integrator = VerletIntegrator(0.001*picoseconds)
    simulation = Simulation(testDes.topology, system, integrator, platform, prop) 
    • With the 14.2 version at least the Intel OpenCL compiler crashes unless I do:

    Emilio Gallicchio,
    Apr 30, 2016, 6:34 AM