QuantumLab-ZY / HamGNN

An E(3) equivariant Graph Neural Network for predicting electronic Hamiltonian matrix
GNU General Public License v3.0
63 stars 15 forks source link

requirements for conda environment? #25

Closed miicck closed 2 months ago

miicck commented 2 months ago

Hi, would it be possible to get an updated list of requirements for the python environment? I've tried quite hard to get a working environment together (see below) to no avail.

I'm aware of the uploaded conda environment mentioned in the README, but it doesn't work on any of the machines I've tried:

image

I've also tried building a conda environment with the requirements listed in the README, using the following environment.yml:

channels:
  - pyg
  - default
  - conda-forge
requirements:
  - python>=3.8
  - numpy==1.21.2
  - pytorch==1.11.0
  - pyg==2.0.4
  - pytorch-lightning==1.5.10
  - e3nn==0.5.0
  - pymatgen==2022.3.7
  - tensorboard==2.8.0
  - tqdm
  - scipy==1.7.3
  - yaml

But conda finds conflicts for this environment:

image

Removing the version restrictions leads to import errors:

image

I've also tried manually creating a conda.yml that doesn't lead to import errors:

channels:
  - pyg
  - defaults
  - conda-forge
dependencies:
  - pyg
  - tqdm
  - yaml
  - numpy
  - scipy
  - pymatgen
  - pytorch-sparse
  - tensorboard
  - e3nn
  - easydict
  - numba
  - llvmlite
  - pytorch-lightning

But this leads to some quite nasty looking runtime errors:

image

QuantumLab-ZY commented 2 months ago

Hi, the uploaded conda environment should work. The issue you encountered might be due to your system missing the libcusparse.so.11 shared library, or not having the library path added to your .bashrc file. Please check if libcusparse.so.11 is installed. You can install cudatoolkit=11.3.1 to obtain this shared library. Once installed, the conda environment should function properly. The screenshot below shows that libcusparse.so.11 is included in cudatoolkit=11.3.1.

image

miicck commented 2 months ago

Hi @QuantumLab-ZY, thanks for the response. I can't see libcusparse.so.11 in the screenshot you sent.

For additional context, my plan is to deploy this model to a large number of machines, which belong to various people. They are understandably nervous about using a conda environment downloaded from the internet in this way, rather than setup in a conventional way. An up-to-date environment.yml file would be really helpful.

QuantumLab-ZY commented 2 months ago

Hi @miicck, I'm sorry, I mistakenly confused libcublas.so.11 with libcusparse.so.11. I'll use conda env export > environment.yaml to package the conda environment. I'll first test installing from this environment.yaml file to ensure there are no issues. If everything works well, I'll upload the environment.yaml file.

miicck commented 2 months ago

Great, thanks @QuantumLab-ZY!

QuantumLab-ZY commented 2 months ago

Hello @miicck,

You can use the conda environment file to set up the environment by running:

conda env create -f environment.yaml

I've tested it, and HamGNN runs successfully. Let me know if you encounter any issues.

Best,
Yang Zhong

miicck commented 2 months ago

Hi @QuantumLab-ZY I've managed to get a working environment setup - thanks for your help. I've submitted a pull request for a small compatibility issue I ran into along the way https://github.com/QuantumLab-ZY/HamGNN/pull/30