Discussion:
[PyOpenCL] Non-empty compiler output warning from Intel OpenCL
Freddie Witherden
2014-05-29 17:23:45 UTC
Permalink
Hi all,

Recently I have been playing around with OpenCL on the Intel Xeon Phi.
A quirk of the OpenCL stack (which also applies to the Intel CPU
stack) is that the compiler is extremely chatty. Running a simple
axpy kernel gives:

/usr/local/lib/python2.7/site-packages/pyopencl/__init__.py:57:
Build on <pyopencl.Device 'Intel(R) Many Integrated Core Acceleration
Card' on 'Intel(R) OpenCL' at 0x1a207d8> succeeded, but said:

Compilation started
Compilation done
Linking started
Linking done
Build started
Kernel <sum> was successfully vectorized
Done.
warn(text, CompilerWarning)
/usr/local/lib/python2.7/site-packages/pyopencl/__init__.py:57:
CompilerWarning: From-binary build succeeded, but resulted in
non-empty logs:
Build on <pyopencl.Device 'Intel(R) Many Integrated Core Acceleration
Card' on 'Intel(R) OpenCL' at 0x1a207d8> succeeded, but said:

Linking started
Linking done
Build started
Kernel <sum> was successfully vectorized
Done.
warn(text, CompilerWarning)


I am not sure the best way to handle this; PyOpenCL does not appear to
expose an API for programmatic control over if these 'warnings' are
generated. It is of course possible to sink the output but this does
not help us to decide if a genuine warning has been generated or not
(which are absolutely of interest and should be displayed).

How have other people handled this?

Regards, Freddie.
Andreas Kloeckner
2014-05-29 17:38:03 UTC
Permalink
Hi Freddie,
Post by Freddie Witherden
Recently I have been playing around with OpenCL on the Intel Xeon Phi.
A quirk of the OpenCL stack (which also applies to the Intel CPU
stack) is that the compiler is extremely chatty. Running a simple
Build on <pyopencl.Device 'Intel(R) Many Integrated Core Acceleration
Compilation started
Compilation done
Linking started
Linking done
Build started
Kernel <sum> was successfully vectorized
Done.
warn(text, CompilerWarning)
CompilerWarning: From-binary build succeeded, but resulted in
Build on <pyopencl.Device 'Intel(R) Many Integrated Core Acceleration
Linking started
Linking done
Build started
Kernel <sum> was successfully vectorized
Done.
warn(text, CompilerWarning)
I am not sure the best way to handle this; PyOpenCL does not appear to
expose an API for programmatic control over if these 'warnings' are
generated. It is of course possible to sink the output but this does
not help us to decide if a genuine warning has been generated or not
(which are absolutely of interest and should be displayed).
There's the current scheme of

/home/andreas/src/pyopencl/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)

which is shown exactly once per program run. IIRC, I introduced this
because the Intel CL compiler is chatty on CPUs, too. You can set that
environment variable to control compiler chattiness. You could
conceivably also set the environment variable programmatically. Does
this do what you want? If not, what behavior would you like?

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20140529/f7dc1e19/attachment.sig>
Freddie Witherden
2014-05-30 10:28:46 UTC
Permalink
Hi Andreas,
Post by Andreas Kloeckner
There's the current scheme of
/home/andreas/src/pyopencl/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)
which is shown exactly once per program run. IIRC, I introduced this
because the Intel CL compiler is chatty on CPUs, too. You can set that
environment variable to control compiler chattiness. You could
conceivably also set the environment variable programmatically. Does
this do what you want? If not, what behavior would you like?
I am wondering if it is possible to silence this initial output or at
least have programmatic control over it. But, more generally, would be
interested in knowing if anyone has had any success differentiating
between these spurious warnings and real warnings (say by looking for
certain keywords in the output).

Regards, Freddie.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20140530/41e35505/attachment.sig>
Andreas Kloeckner
2014-05-30 15:14:50 UTC
Permalink
Post by Freddie Witherden
Hi Andreas,
Post by Andreas Kloeckner
There's the current scheme of
/home/andreas/src/pyopencl/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)
which is shown exactly once per program run. IIRC, I introduced this
because the Intel CL compiler is chatty on CPUs, too. You can set that
environment variable to control compiler chattiness. You could
conceivably also set the environment variable programmatically. Does
this do what you want? If not, what behavior would you like?
I am wondering if it is possible to silence this initial output or at
least have programmatic control over it. But, more generally, would be
interested in knowing if anyone has had any success differentiating
between these spurious warnings and real warnings (say by looking for
certain keywords in the output).
Either of those sound like interesting functionality. I'd be happy to
consider a patch.

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20140530/99d0ac28/attachment.sig>
Loading...