CompilerWarning with OpenCL

5.4k views Asked by At

Woke up today and all of a sudden get

C:\Python27\lib\site-packages\pyopencl\__init__.py:61: CompilerWarning: Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.
  "to see more.", CompilerWarning)
C:\Python27\lib\site-packages\pyopencl\cache.py:101: UserWarning: could not obtain cache lock--delete 'c:\users\User\appdata\local\temp\pyopencl-compiler-cache-v2-uiduser-py2.7.3.final.0\lock' if necessary
  % self.lock_file)

When I ran any sort of PqOpenCL code, ex:

import numpy
import pyopencl as cl
import pyopencl.array as clarray
from pyopencl.reduction import ReductionKernel

ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
krnl = ReductionKernel(ctx, numpy.float32, neutral="0",
                       reduce_expr="a+b", map_expr="x[i]*y[i]",
                       arguments="__global float *x, __global float *y")
x = clarray.arange(queue, 400, dtype=numpy.float32)
y = clarray.arange(queue, 400, dtype=numpy.float32)
m = krnl(x, y).get()

Sample and part of the solution came from here

Solution suggested rolling back numpy, which I did from 1.8.0 to 1.7.2 but still same problem

Edit 1

Added as per suggestion

import os os.environ['PYOPENCL_COMPILER_OUTPUT'] = '1'

C:\Python27\lib\site-packages\pyopencl\__init__.py:57: CompilerWarning: From-source build succeeded, but resulted in non-empty logs:
Build on <pyopencl.Device 'Intel(R) HD Graphics 4000' on 'Intel(R) OpenCL' at 0x51eadff0> succeeded, but said:

fcl build 1 succeeded.
fcl build 2 succeeded.
bcl build succeeded.

  warn(text, CompilerWarning)
1

There are 1 answers

0
M4rtini On
import os
os.environ['PYOPENCL_COMPILER_OUTPUT'] = '1'

Do this to see the compiler output, i've gotten the same message before. It was just the intel opencl compiler saying it had vectorized\optimized the opencl kernel.