OpenCL backend still requires pycuda to be installed
I wanted to try out the OpenCL backend on a machine that does not have the CUDA SDK or pycuda installed. Unfortunately, pystencils imports stuff from pycuda in multiple places throughout the code, so I cannot use the OpenCL backend on this machine.
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related. Learn more.
Activity
- Michael Kuron mentioned in merge request !76 (merged)
mentioned in merge request !76 (merged)
- Stephan Seitz mentioned in merge request !77 (merged)
mentioned in merge request !77 (merged)
- Martin Bauer closed via merge request !77 (merged)
closed via merge request !77 (merged)
- Martin Bauer mentioned in commit 09a59f7f
mentioned in commit 09a59f7f
- Author Maintainer
This is still a problem:
Traceback (most recent call last): File "<stdin>", line 30, in create_scenario return LatticeBoltzmannStep(periodicity=(True, True, True), domain_size=domain_size, compressible=True, stencil='D3Q19', collision_rule=cr, optimization={'target': target}) File "./lbmpy/lbstep.py", line 69, in __init__ latex_name='src', dtype=field_dtype, alignment=alignment) File "./pystencils/datahandling/serial_datahandling.py", line 128, in add_array self.gpu_arrays[name] = gpuarray.to_gpu(cpu_arr) AttributeError: 'NoneType' object has no attribute 'to_gpu'
- Michael Kuron reopened
reopened
- Maintainer
The OpenCL backend was not integrated yet into the data handling classes nor the usual
create_kernel
methods. We weren't sure whether there were users for it. Feel free to add a PR! - Maintainer
I decided to extend data handling to handle alternative GPU array libraries (pyopencl, torch, tensorflow) today (tough torch, tensorflow only through subclassing a more general approach). I guess we only have to dispatch the functions for create array/transfer array to GPU/transfer array to CPU.
- Author Maintainer
That sounds good. I actually tried yesterday to wrap all
import pycuda.gpuarray
intotry
/except
blocks and loadpyopencl.array
instead when it's not found. That works with a small wrapper as the APIs are essentially identical. I ended up not following through with this approach as it gets a bit messy. Ideally, we'll have a wrapper around pycuda/pyopencl and use that wherever pystencils and lbmpy currently call into pycuda. Then we also won't have to have separate CUDA/OpenCL tests and everything could run everywhere. - Stephan Seitz mentioned in merge request !85 (closed)
mentioned in merge request !85 (closed)
- Stephan Seitz mentioned in commit 12459396
mentioned in commit 12459396
- Stephan Seitz closed
closed