Issue running examples
I am trying to run the lid driven cavity 2d example. I have installed the package from source but I am getting the following error:
Traceback (most recent call last):
File "/home/m4pc/src/XLB/examples/cfd/lid_driven_cavity_2d.py", line 107, in <module>
velocity_set = xlb.velocity_set.D2Q9(precision_policy=precision_policy, backend=compute_backend)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: D2Q9.__init__() got an unexpected keyword argument 'backend'
Thank you for any help
Hi @mandralis, I was running into the same error when I'd installed the package through pip. It seems like there was an interface mismatch where some models expected backend vs compute_backend as an input argument.
https://github.com/Autodesk/XLB/pull/105 looks to have updated the examples to be compatible with the source code, though that change hasn't been externally published (at least as of v0.2.1) so any installations from PyPI would likely raise the error you mentioned.
How are you installing from source? I was able to get the lid_driven_cavity_2d.py to run successfully when building from ead7d0d8e82aa56c41d60019ba6e645ceca4baee using the below. I wasn't sure how to specify the CUDA requirements when installing in editable mode so I just called that line (directly from setup.py) manually first and things worked out.
pip install "jax[cuda12]>=0.4.34"
pip install -e .
Hope this issue has been resolved. Thanks @jcusick13 for your correct response.