glotzerlab / hoomd-examples

HOOMD-blue example scripts.
BSD 3-Clause "New" or "Revised" License
35 stars 15 forks source link

AttributeError: module 'hoomd' has no attribute 'device' #36

Closed namus closed 3 years ago

namus commented 3 years ago

I have installed hoomd using conda as follows: conda install -c conda-forge fresnel freud gsd hoomd jupyterlab matplotlib

However, while trying to access the device in the notebooks (cpu = hoomd.device.CPU()), I get the following error: AttributeError: module 'hoomd' has no attribute 'device'

hoomd.version '2.9.6'

How do I resolve this issue? Thanks.

cbkerr commented 3 years ago

Install the beta version using the following command:

conda install -c conda-forge/label/hoomd_dev -c conda-forge hoomd

On Tue, Jun 29, 2021 at 10:42 AM Suman Chakrabarty @.***> wrote:

I have installed hoomd using conda as follows: conda install -c conda-forge fresnel freud gsd hoomd jupyterlab matplotlib

However, while trying to access the device in the notebooks (cpu = hoomd.device.CPU()), I get the following error: AttributeError: module 'hoomd' has no attribute 'device'

hoomd.version '2.9.6'

How do I resolve this issue? Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/glotzerlab/hoomd-examples/issues/36, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFCL5HJVCEDAVWNINSBTE73TVHLTJANCNFSM47QJM6EQ .

namus commented 3 years ago

Install the beta version using the following command: conda install -c conda-forge/label/hoomd_dev -c conda-forge hoomd

Thanks! CPU version works now, but how do I install the GPU enabled beta version? I am getting the following error: RuntimeError: This build of HOOMD does not include GPU support.

namus commented 3 years ago

conda install -c conda-forge/label/hoomd_dev -c conda-forge hoomd==gpu*

... does not work, since it downgrades to conda-forge::hoomd-2.9.6-gpu_py38h3e5ef92_1

joaander commented 3 years ago

@namus As far as I know, conda should autodetect if you have a CUDA GPU and choose the GPU enabled package. Make sure you have upgraded to a recent version of conda.

@bdice Any thoughts on how to bypass the autodetect and force installation of the gpu dev package?

bdice commented 3 years ago

@namus Try this, perhaps it will work?

conda install -c conda-forge/label/hoomd_dev -c conda-forge hoomd=3.0.0dev7=gpu_py38*

The autodetection depends on the user's system and conda version. You may also need to upgrade conda so that it supports the cuda metapackage correctly.

namus commented 3 years ago

@bdice Yes, it worked. Thanks!