4 Replies Latest reply on May 8, 2018 5:00 AM by Intel Corporation

    running OpenCL/PyOpenCL

    hector17

      I was wondering if it is possible to run OpenCl/PyOpenCL on intel AI DevCloud.

       

      I believe I need to install OpenCL run time provided by intel. However, the installer is telling me that I need root access.

      So I was unsure how to get PyOpenCL running.

       

      Thank you very much.

        • 1. Re: running OpenCL/PyOpenCL
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi ,
          Please follow below steps,
          1)conda create -n  opencl_env python=3
          2)source activate opencl_env
          3)conda install -c conda-forge pyopencl
          4)try importing pyopencl
          python
          >>> import pyopencl

          Thanks
           

          • 2. Re: running OpenCL/PyOpenCL
            hector17

            Hello,

            thank you for your quick answer! I tried out the method you suggested. However, I am not sure whether that fixed the issue.

            I can import pyopencl without issues. However, running the following line gives me an error:

             

            >>> import pyopencl as cl

            >>> cl.get_platforms()

            Traceback (most recent call last):

              File "<stdin>", line 1, in <module>

              File "/home/u13515/.conda/envs/opencl_env/lib/python3.6/site-packages/pyopencl/cffi_cl.py", line 691, in get_platforms

                _handle_error(_lib.get_platforms(platforms.ptr, platforms.size))

              File "/home/u13515/.conda/envs/opencl_env/lib/python3.6/site-packages/pyopencl/cffi_cl.py", line 664, in _handle_error

                raise e

            pyopencl.cffi_cl.LogicError: clGetPlatformIDs failed: <unknown error -1001>

             

            From what I understand this is because the OpenCL driver/runtime for cpu is not correctly configured.

            This is what I found from PyOpenCL wiki: https://wiki.tiker.net/OpenCLHowTo#Installing_the_Intel_CPU_ICD

            The driver/runtime that the article is referring to is found on this intel page: OpenCL™ Drivers and Runtimes for Intel® Architecture | Intel® Software

             

            I would love to just go ahead and install the drivers/runtimes. However, because they are .rpm, it prompts me to install as a root user.

            And so I was unable to install them.

             

            Any idea how to proceed from here?

             

            Thank you.

            • 3. Re: running OpenCL/PyOpenCL
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi 
              can you please follow below steps 
              1)export LIBRARY_PATH=${LIBRARY_PATH}:/glob/supplementary-software/opencl/lib64/
              2)pip install pyopencl --user

              3)And before using the module (add to two lines to ~/.bashrc):
                  3a)export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/glob/supplementary-software/opencl/lib64/
                  3b)export PYOPENCL_CTX='0'
              4)    . ~/.bashrc

              after executing all the above steps please try importing pyopencl module 


              Thanks

              • 4. Re: running OpenCL/PyOpenCL
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Hi,
                As we haven't received any response, we are closing this thread.
                Thanks