-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-empty compiler output #756
Comments
I'm a bit puzzled why this behavior should be different between PyOpenCL and a C++ program calling OpenCL directly. One possible reason that these messages got cached from an old version of the driver. You can check for this by deleting PyOpenCL's build cache: # Careful! Double check this command before running it, to ensure it does what you intend.
rm -Rf $HOME/.cache/pyopencl and then rerunning. |
FWIW, I was not able to reproduce this with CUDA 12.2 on Debian unstable building for a TITAN X. |
Thanks, tried it, but unfortunately didn't work for me. I also verified that compiled C code and pyopencl are indeed using the same opencl library. With
I really have no idea why this message is originated. |
Finally I found it. After inserting print statements to the pyopencl C++ code, I noticed that the following line was added to the kernel source:
If I remove such line (modifying pyopencl C++ code) I don't get anymore the compiler warning. Adding such line to my C++ opencl kernel, makes me getting the same build log. So that's the reason in the end, and pyopencl is consistent with C/C++ opencl interface. Update: this is not the real cause. |
Interesting! Thanks for tracking this down, I had forgotten about that. :) I still kind of don't understand why having this triggers the warning it does; the warning seems entirely unrelated to that variable definition? |
Yea, the compiler message seems totally unrelated to that variable, yet it’s anyway triggered by it. Don’t know what nvidia is doing here; we all know OpenCL is not bvidia top priority (to say an euphemism). |
The reason the variable is there is to defeat broken vendor caches. I don't remember specifics, but in PyOpenCL's early days, I spent a long time tracking down what ended up being a bug in an ICD compiler cache. The ICD compiler did not notice that a header file included by the source was changed, and insisted on using a (stale) cached binary. That variable definition was there to help "convince" ICDs that they're looking at new source code every time, while PyOpenCL's own caching system is (hopefully) less broken than the ones built into the ICD. That said, for some specific ICDs that (competently) do their own caching, PyOpenCL's caching system imposes unnecessary overhead, which we're now thinking of (selectively) removing. See #738 for some discussion. |
I now realized I gave a wrong explanation. I've been get confused by (I think) some build caching mechanism that the nvidia ICD compiler is apparently using. From C interface, the ICD compiler builds the kernel, and get non empty build info, only the first time I execute the program, while in all subsequent program executions
In the end, nothing is due to pyopencl. |
Glad to hear everything got resolved. I'll go ahead and close this issue, LMK if anything else comes up. |
I always get a non-empty compiler output for any kernel I compile. The complete warning message says:
To Reproduce
Sample code to reproduce:
Expected behavior
The compiler output should be empty. When I use my OpenCL from C/C++ code,
clGetProgramBuildInfo
returns empty messages.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: