conda cpu only build

94 views
Skip to first unread message

Michael Howard

unread,
Apr 5, 2021, 4:02:36 PM4/5/21
to hoomd-users
Hello all,

This is a silly question, but what is the command to install the CPU-only version of HOOMD from conda-forge? I have `hoomd=2.9.3` pinned in a requirements.txt I use for CI testing, which seems like it installs a GPU-enabled version of HOOMD because conda pulls in the cuda toolkit as a dependency after it installs HOOMD. I don't have a need for the GPU build, so I'd like to get a CPU-only install to decrease the environment download time. Thanks!

Regards,
Mike

bd...@umich.edu

unread,
Apr 5, 2021, 9:06:15 PM4/5/21
to hoomd-users
Hi Mike,

You have at least two options, which I will explain below. The short version is:

1. Try pinning to HOOMD 2.9.4 or newer (2.9.6 is the latest). Those builds should know whether to pull CPU or GPU based on the hardware and __cuda conda metapackage.
2. Use the pinning: "hoomd=2.9.3=*cpu*" if you require HOOMD 2.9.3.

Longer version: I added a runtime requirement on the __cuda metapackage for hoomd 2.9.4, to prevent GPU builds from being chosen on non-GPU systems: https://github.com/conda-forge/hoomd-feedstock/pull/34/files

The change I made in that PR to require the __cuda metapackage should automatically select GPU builds on systems with CUDA support (NVIDIA GPUs) and CPU builds on systems without CUDA support. This change was made for 2.9.4 and applies to that version or higher. Note that the __cuda metapackage requires conda >= 4.8.

We have had two builds (CPU and GPU) for some time, but as you noticed, conda would always automatically select the GPU build by default, even if no GPUs are available (I'm not sure how conda chooses which build string to prefer).

Alternatively, you should be able to force a specific build string using this syntax: "hoomd=2.9.3=*cpu*". Note that the runtime requirement may not allow conda to solve a build string for a GPU-enabled package on systems without GPUs.

Please follow up and let me know if one or both of these solutions work -- I haven't tested the metapackage selection on very many systems and I'd like to know that things work as expected for you.

Thanks,
Bradley

Michael Howard

unread,
Apr 6, 2021, 9:56:59 AM4/6/21
to hoomd-users
Hi Bradley,

Thanks for the explanation! I pinned 2.9.6, and it looks like I got the CPU build. Cool! Just FYI, this is on CircleCI with a Docker Small executor, and not needing CUDA shaved about 2 minutes off my environment download time [which makes a 2x difference in total time... fast tests :-)].

I'll keep an eye on my CI builds to make sure conda consistently pulls the CPU version, but it looks like the automatic selection worked for me.

Regards,
Mike

Reply all
Reply to author
Forward
0 new messages