Have you looked at the OpenCL fluid simulation Sailfish before?http://sailfish.us.edu.pl/index.html
It uses pyopencl!
I have been hacking away to get this running under Windows. I have installed Python all the required modules, including compiling pyopencl against the ATI Stream 2.0 SDK.
I had to make a few modifications to Sailfish as it was designed for Linux. This included removing a hardcoded path, and adding support for the OpenCL ICD (selecting an OpenCL platform...).
I have had mixed results.
The example scripts compile fine, and run with no exceptions, yet I get black pixels, and the frames simulated per second is impossibly fast. I have the feeling the kernel is not running, but no error seems to be generated...
Also the ATI compiler always returns warnings that the -cl-single-precision-constant and -cl-fast-relaxed-math compiler options are not supported despite being in the OpenCL specification...
But I can get the simulation to work perfectly and produce the red pixels if I run it via clprofile.exe! It probably runs slower though thanks to all the logging to stdout and the CSV file...
Why does profiling make it work?!?
Also the 3D simulations always fail with the following error:
Traceback (most recent call last):
File "c:\sailfish\examples\lbm_ldc_3d.py", line 54, in <module>
File "C:\python26\lib\site-packages\sailfish\lbm.py", line 715, in run
File "C:\python26\lib\site-packages\sailfish\vis2d.py", line 312, in main
File "C:\python26\lib\site-packages\sailfish\lbm.py", line 532, in sim_step
File "C:\python26\lib\site-packages\sailfish\backend_opencl.py", line 54, in r
cl.enqueue_nd_range_kernel(self.queue, kernel, global_size, kernel.block)
pyopencl.LogicError: enqueue_nd_range_kernel failed: invalid value - global/work
work sizes have differing dimensions
I have traced this back possibly being to line 517 in lbm.py:
self.kern_grid_size = (self.options.lat_nx/self.block_size * self.options.lat_ny, self.options.lat_nz)
but if I change this to:
self.kern_grid_size = (self.options.lat_nx/self.block_size, self.options.lat_ny, self.options.lat_nz)
the script runs but I get black pixels (even when inside the profiler).
Could you try this out on your setup and see what you get?
I have attached the modified python files.
In case it is any help I have attached a GPU Caps Viewer XML file.
Latest 32bit 2.6 python, and latest version of all required modules.
Compiled pyopencl with Visual Studio 2008 Professional SP1.
I am only running OpenCL on CPU as I have not got a graphics card for my new system yet.