title: Getting OpenCL to work on Linux laptop with Optimus technology
body: <p>I have an installation of Kubuntu 13.10 on my laptop which has an Nvidia GT555m with optimus technology. I am having some trouble getting my C++ code with OpenCL to compile.</p>
  
  <p>The error I keep getting is <code>Cannot find -lOpenCL</code>. Doing a quick search with the GNU find utility gives me the following:</p>
  
  <pre><code>/usr/lib32/nvidia-319/libOpenCL.so.1
  /usr/lib32/nvidia-319/libOpenCL.so
  /usr/lib32/nvidia-319/libOpenCL.so.1.0
  /usr/lib32/nvidia-319/libOpenCL.so.1.0.0
  /usr/lib/x86_64-linux-gnu/libOpenCL.so
  /usr/lib/nvidia-319/libOpenCL.so.1
  /usr/lib/nvidia-319/libOpenCL.so
  /usr/lib/nvidia-319/libOpenCL.so.1.0
  /usr/lib/nvidia-319/libOpenCL.so.1.0.0
  </code></pre>
  
  <p>I have the following OpenCL development packages installed:</p>
  
  <pre><code>opencl-headers
  nvidia-opencl-dev
  </code></pre>
  
  <p>I also tried the utility <code>clinfo</code> to see if I get any information, but I get the following error:</p>
  
  <pre><code>clinfo: error while loading shared libraries: libOpenCL.so.1: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>Does anyone have any experience setting up a Linux development environment with OpenCL on their optimus laptops? </p>
  
  <p>I was under the impression that I do not need to do anything fancy to get this working.</p>
  
  <p><strong>EDIT</strong>: Ok it seems the reason I was not managing to compile was because I was mixing up headers and libraries. Using the following compiles my code well:</p>
  
  <pre><code>g++ -std=c++11 -I /usr/local/cuda-5.5/include vadd.cpp -L /usr/lib/nvidia-331 -lOpenCL
  </code></pre>
  
  <p>I am getting another error during runtime now (but at least I managed to compile!). The error is as follows:</p>
  
  <pre><code>ERROR: clGetPlatformIDs
  -1001
  </code></pre>
  
  <p>From doing some research this means I probably do not have the ICD portion of nvidias toolkit installed? What I cannot understand is - where to find it!</p>