seekrcentral / seekr2

Simulation-Enabled Estimation of Kinetic Rates - Version 2
MIT License
27 stars 6 forks source link

Issue running OpenMM in the tutorial #5

Closed bensebaer closed 3 years ago

bensebaer commented 3 years ago

Hi Lane, I was running the tutorial file 'sample_input_mmvt_openmm.xml' and observed the following error while running:

python run.py any /path/to/model.xml

#########Output: ############## mark0 anchor 0 has not run the minimum number of steps 0 of 100000 anchor 1 has not run the minimum number of steps 0 of 100000 anchor 2 has not run the minimum number of steps 0 of 100000 anchor 3 has not run the minimum number of steps 0 of 100000 anchor 4 has not run the minimum number of steps 0 of 100000 anchor 5 has not run the minimum number of steps 0 of 100000 anchor 6 has not run the minimum number of steps 0 of 100000 anchor 7 has not run the minimum number of steps 0 of 100000 anchor 8 has not run the minimum number of steps 0 of 100000 anchor 9 has not run the minimum number of steps 0 of 100000 anchor 10 has not run the minimum number of steps 0 of 100000 anchor 11 has not run the minimum number of steps 0 of 100000 anchor 12 has not run the minimum number of steps 0 of 100000 running anchor_index: 0 restart: False total_simulation_length: 100000 num_transitions: 0 Traceback (most recent call last): File "run.py", line 872, in run(model, instruction, min_total_simulation_length, File "run.py", line 605, in run run_openmm(model, anchor_index, restart, File "run.py", line 484, in run_openmm sim_openmm_obj = mmvt_sim_openmm.create_sim_openmm( File "/home/g035896/Software/anaconda3/envs/seekr2/lib/python3.8/site-packages/seekr2-0+untagged.130.gc6773e3.dirty-py3.8.egg/seekr2/modules/mmvt_sim_openmm.py", line 168, in create_sim_openmm add_simulation(sim_openmm, model, topology, positions, box_vectors) File "/home/g035896/Software/anaconda3/envs/seekr2/lib/python3.8/site-packages/seekr2-0+untagged.130.gc6773e3.dirty-py3.8.egg/seekr2/modules/mmvt_sim_openmm.py", line 101, in add_simulation sim_openmm.simulation = openmm_app.Simulation( File "/home/g035896/Software/anaconda3/envs/seekr2/lib/python3.8/site-packages/simtk/openmm/app/simulation.py", line 105, in init self.context = mm.Context(self.system, self.integrator, platform, platformProperties) File "/home/g035896/Software/anaconda3/envs/seekr2/lib/python3.8/site-packages/simtk/openmm/openmm.py", line 13232, in init _openmm.Context_swiginit(self, _openmm.new_Context(*args)) simtk.openmm.OpenMMException: Specified a Platform for a Context which does not support all required kernels

############################

I installed openmm (7.5.1) by 'conda install -c conda-forge openmm' in a clean conda-environment with python 3.8.10. I tested my seekr2 install and it passed all the tests (except for the NAMD-test because I didn't exported the path to the binary). I also tested my OpenMM installation and environment by running a simulation using the same environment and observe no issues there. I used the simulateAmber.py file from the example-folder in the OpenMM installation.

I also tested the 'sample_input_mmvt_namd.xml' file with my installation. After exporting the path to the namd-executable, I can run 'python run.py any /path/to/model.xml' flawlessly.

Nvidia driver:

Output to: 'nvidia-smi'

+-----------------------------------------------------------------------------+ | NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 Tesla V100-PCIE... On | 00000000:81:00.0 Off | 0 | | N/A 34C P0 23W / 250W | 0MiB / 16160MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+

Do you have any idea what is causing this issue?

Thank you in advance and best regards Jens Wilbert

lvotapka commented 3 years ago

Ah, this is probably because OpenMM didn't find CUDA when it was installed.

Inside the python terminal, can you type:

from simtk import openmm
openmm.Platform_getPlatformByName("CUDA")

and let me know the output. If this command throws an error, you should make sure that CUDA_HOME is defined in a linux terminal:

echo $CUDA_HOME
bensebaer commented 3 years ago

Yes you are right CUDA_HOME is not set and is not found in python. Do I need to install CUDA and set CUDA_HOME before installing openmm by conda? Or do I have to set the $CUDA_PATH to the toolkit that ships with the openmm conda-package?

lvotapka commented 3 years ago

Yes, you will need to install CUDA. What version of Linux are you using? Is it on a university network, a supercomputer, or a personal machine? Do you have sudo privileges?

If you have a system administrator who can install CUDA for you, that would probably be the best option. For instance, I would expect most supercomputers and clusters to have CUDA easily available to all users.

However, if you are stuck doing it yourself on your own machine, you can follow the instructions from NVIDIA: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html. Some Linux distributions have automatic installers that can install a version of CUDA (for instance, Ubuntu has apt-get), but I've had bad luck with these, and better luck installing CUDA from source using NVIDIA's guide. Fair warning: tread carefully with this option - CUDA is very difficult to install yourself.

lvotapka commented 3 years ago

And once you install CUDA, OpenMM should automatically detect it. Although if not, you'll have to reinstall OpenMM. You will also need to reinstall the Seekr2 OpenMM Plugin by deleting the build/ directory inside of seekr2plugin/ and start over from the "mkdir build" step.

bensebaer commented 3 years ago

Hi Lane, thank you for your detailed reply. I was installing on a supercomputer and yes we have a version of CUDA installed. Since we didn't have the newest version of CUDA I tried to install openmm from source in the last days, but was still struggling with the install.

In the end, I figured out I can install openmm in conda linked to any CUDA-verison by specifying the requested CUDA-version:

conda install -c conda-forge openmm cudatoolkit==10.0

for CUDA10.0, according to the manual any version of CUDA>=9.2 is supported

Also, a good way to install ccmake without admin-privileges is using conda: conda install cmake

Perhaps, those tips might be useful for others. Anyway, thank you very much for your support!

Best Jens