openmm-torch
openmm-torch copied to clipboard
conda-forge builds do not install properly on linux without CUDA
I am using a linux machine which does not have CUDA and does not have NVIDIA GPUS. When I install the latest version of opemm-torch and openmm using this command:
mamba install -c conda-forge -c "conda-forge/label/openmm-torch_rc" -c "conda-forge/label/openmm_rc" openmm=8 openmm-torch=1
I get errors when importing openmmtorch:
python
Python 3.11.0 | packaged by conda-forge | (main, Jan 14 2023, 12:27:40) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import openmmtorch
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/export/users/sfarr/miniconda3/envs/test_rc/lib/python3.11/site-packages/openmmtorch.py", line 15, in <module>
import _openmmtorch
ImportError: libtorch_cuda.so: cannot open shared object file: No such file or directory
I think this is because conda installs these incompatible packages:
openmm-torch 1.0rc1 cuda112py311h756f8fe_0 conda-forge/label/openmm-torch_rc
pytorch 1.13.1 cpu_py311h410fd25_0 conda-forge
openmm-torch uses a pytorch cuda version, but the pytorch installed is a cpu only version.
You can override the CUDA detection: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-virtual.html#overriding-detected-packages
Should we put this workaround on the README install guide?
Users shouldn't need a workaround. It ought to automatically install compatible packages.
As I understand it that would require us providing a conda-forge build of openmm-torch that is built against, and depends on, conda-forge pytorch-*-cpu. The pytorch-*-gpu versions on conda-forge have a dependency on __cuda so can only be installed by conda if the user has a CUDA installation or overrides the CUDA detection.
This is still a problem with the 1.4 release. It is the same as the issues on the feedstock: https://github.com/conda-forge/openmm-torch-feedstock/issues/37