maweigert / spimagine

GPU accelerated volume rendering / processing in Python
BSD 3-Clause "New" or "Revised" License
117 stars 17 forks source link

Module 'pyopencl' has no attribute 'enqueue_write_buffer' #33

Closed WeisongZhao closed 5 years ago

WeisongZhao commented 5 years ago

Hi, Martin Weigert I have met an error as follow: python -m spimagine

File "/anaconda3/lib/python3.6/site-packages/spimagine/gui/glwidget.py", line 317, in dataModelChanged self.renderer.set_data(self.dataModel[0], autoConvert=True) File "/anaconda3/lib/python3.6/site-packages/spimagine/volumerender/volumerender.py", line 258, in set_data self.update_matrices() File "/anaconda3/lib/python3.6/site-packages/spimagine/volumerender/volumerender.py", line 314, in update_matrices self.invMBuf.write_array(invM.flatten().astype(np.float32)) File "/anaconda3/lib/python3.6/site-packages/gputools/core/ocltypes.py", line 94, in write_array return cl.enqueue_write_buffer(queue, self.data, prepare(data), AttributeError: module 'pyopencl' has no attribute 'enqueue_write_buffer' Abort trap: 6

I have installed the pyopencl 2018.2.2.

These are my versions for the Macbook Air 2018

(base) bash-3.2$ clinfo | grep Version Platform Version OpenCL 1.2 (Oct 31 2017 18:19:43) Device Version OpenCL 1.2 Driver Version 1.1 Device OpenCL C Version OpenCL C 1.2 Device Version OpenCL 1.2 Driver Version 1.2(Nov 9 2017 18:56:42) Device OpenCL C Version OpenCL C 1.2

If there exists an error in pyopencl installation?

maweigert commented 5 years ago

Hi Weisong,

Yes, I can reproduce this with 2018.2.2 version of pyopencl, so thanks for noticing! Somehow enqueue_write_buffer was removed from the pyopencl API, which causes this error. I need to look into that. Until then, everything should work if you install an earlier version of pyopencl, e.g.

pip install pyopencl==2018.1

Let me know if that fixes things...

WeisongZhao commented 5 years ago

That works, thanks a lot.

WeisongZhao commented 5 years ago

BTW, if the volume size as: 8000x3000x100, how did you render the volume to let it not so 'flat'.

maweigert commented 5 years ago

You can do volshow(data, stackUnits = (1,1,10) ) to increase the pixelsize in Z e.g. 10 fold. You can as well set the stack units from the gui via the viewing settings panel, lower right corner.

WeisongZhao commented 5 years ago

It works well, thank you.