Hi all,
I am a very new HOOMD user coming over from LAMMPS and looking to see if I can improve my performance using GPU-based MD simulations. I have an NVIDIA GeForce GTX 1650 Ti with Max-Q Design GPU on the computer I want to build HOOMD on, which is running Windows 11 and Windows Subsystem for Linux 2. Following the detailed instructions for setting up CUDA on WSL2 from the NVIDIA website and then the instructions for building and installing HOOMD from its documentation, I built HOOMD using cmake with the following command:
cmake -B build/hoomd -S hoomd-blue -GNinja -DCMAKE_CXX_FLAGS=-march=native -DCMAKE_C_FLAGS=-march=native -DENABLE_GPU=ON -DENABLE_MPI=ON -DSINGLE_PRECISION=ON -DHOOMD_GPU_PLATFORM=CUDA
And everything built without error. There were some warnings related to typing with single precision enabled, but everything worked and I was able to install the package. After successfully running a test simulation of a Kob-Anderson glass on my CPU, I changed the device to GPU and am encountering this error when the simulation gets to the run step:
**ERROR**: invalid device ordinal before /hoomd/Autotuner.h:496
Traceback (most recent call last):
File "/home/slayding/test-lj.py", line 186, in <module>
sim.run(10_000)
File "/home/slayding/miniconda3/envs/hoomd-gpu/lib/python3.9/site-packages/hoomd/simulation.py", line 455, in run
self.operations._schedule()
File "/home/slayding/miniconda3/envs/hoomd-gpu/lib/python3.9/site-packages/hoomd/operations.py", line 186, in _schedule
self.integrator._attach()
File "/home/slayding/miniconda3/envs/hoomd-gpu/lib/python3.9/site-packages/hoomd/md/integrate.py", line 310, in _attach
super()._attach()
File "/home/slayding/miniconda3/envs/hoomd-gpu/lib/python3.9/site-packages/hoomd/md/integrate.py", line 48, in _attach
self._forces._sync(self._simulation, self._cpp_obj.forces)
File "/home/slayding/miniconda3/envs/hoomd-gpu/lib/python3.9/site-packages/hoomd/data/syncedlist.py", line 244, in _sync
raise err
File "/home/slayding/miniconda3/envs/hoomd-gpu/lib/python3.9/site-packages/hoomd/data/syncedlist.py", line 240, in _sync
self._attach_value(item, False)
File "/home/slayding/miniconda3/envs/hoomd-gpu/lib/python3.9/site-packages/hoomd/data/syncedlist.py", line 202, in _attach_value
value._attach()
File "/home/slayding/miniconda3/envs/hoomd-gpu/lib/python3.9/site-packages/hoomd/md/pair/pair.py", line 170, in _attach
self._cpp_obj = cls(self._simulation.state._cpp_sys_def,
RuntimeError: HIP Error
And I really don't know what to make of it. I have run other scientific computing packages written for CUDA on this same device without issue, so I know that my GPU functions. Unfortunately I'm really not a computer expert so I've been having trouble diagnosing the error.
Has anyone else run into trouble setting up HOOMD on a WSL2 system? I'm hoping that there's some workaround for this so that I can start doing some benchmarking for the systems I typically study.
Thank you so much,
Sam