Joe Haywood <[email protected]> writes: > Hi All, > > I have been converting my Monte Carlo code from cuda to Pyopencl and have run > into the following problem. I am working between two machines 1)Ubuntu 14.04 > machine with cuda 7.0 proprietary drivers and libraries, intel's most recent > opencl drivers, and amd's opencl drivers, Pyopencl from default Ubuntu repo > and 2) Windows 7 Ultimate with AMD SDK from about 2 years ago with > python(x,y) and the Pyopencl distributed with that also from about 2 years > ago. > > On the Ubuntu machine I have the original Cuda code AND the Pyopencl code. I > made a lot of changes to the cuda code to improve the performance like > removing branching, changing ifs to switches and removing unused functions > and variables. I then converted the cuda kernels to opencl kernels, copying > and pasting a lot of the code directly. When I run the program in cuda on my > test dataset I get the answer I expect, 100 +- small deviations due to > randomness. The Pyopencl code returns ~twice that or 200 +- small deviations. > It returns 200 no matter which opencl library is called, Nvidia (GPU calc), > Intel (CPU calc), or AMD (CPU Calc). > > On the Windows machine, the exact same Pyopencl code returns the expected > value of 100. > > Before running on the Windows machine I figured I had copied something > incorrectly but every variable I checked prints approximately the same value > that cuda prints within reason except for the final value I check, the > Maximum of the output array. I expect them to be very close but the Pyopencl > one is ~half the value of the cuda value. This is where the factor of 2 comes > from. No other variables are different.
As it stands, there's very little to go on your description in terms of what might be causing this issue. A few questions that may help: first, does your code use random numbers produced by PyOpenCL? Second, does your code rely on complex numbers as implemented by PyOpenCL? Third, could you sprinkle your kernel code with printf() calls and from that derive some sort of helpful information on what might going differently? Another thing to try would be whether the PyOpenCL version plays any role in this. It will likely be easier to change versions on the Linux box, so that I would probably suggest trying to get the Linux box to exactly the same version as the Windows box and see if that has any effect. Those are all the suggestions I can think of right now, I hope that at least one of them helps. Andreas
signature.asc
Description: PGP signature
_______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
