How to solve Mismatch between hwloc headers and library, using v1 headers with v2 library on Collab?

Question:

I’ve been using Gromacs on google Colab for more than a year. I’ve install the Gromacs using https://colab.research.google.com/github/pb3lab/ibm3202/blob/master/tutorials/lab07_MDsims.ipynb this method, it worked pretty smoothly but last night when I ran the cell it, it showed some wired error that I wasn’t used to see
enter image description here

Then I tried to find the solution online I came across this code

!sudo  ln  -s /usr/lib/x86_64-linux-gnu/libhwloc.so /usr/lib/x86_64-linux-gnu/libhwloc.so.5

Then it worked but when I wanted to run the last cell which it’s the actuall MD simulation it needs computation power and gpu I got another error.

Assertion failed: Condition: (hwloc_get_api_version() < 0x20000) Mismatch between hwloc headers and library, using v1 headers with v2 library

and I really don’t know how to solve this, and I really need it to work. It would be amazing if you could help me.

Asked By: Muzeita

||

Answers:

This doesn’t appear to be a Python specific problem so much as a problem with Gromacs and how you’ve installed it (unless the last error you posted comes from python code, but based on the first link you posted I don’t believe this to be the case). The software you run (presumably gmx) to get that last error is built using the v1 headers for hwloc which appears to be a hardware locality library, but the shared object you’ve symbolically linked to /usr/lib/x86_64-linux-gnu/libhwloc.so.5 appears to be the v2 version of the library, which is incompatible with the v1 headers. Likely there are some function calls that simply don’t work with this mismatch and the devs were right to ensure version matching.

I think the simplest solution is for you to try to find the v1 shared object and link it as you did with ln previously. In an ideal world you may be able to find it with ls /usr/lib/x86_64-linux-gnu | grep hwloc which is a command to show you all the libraries in that directory that contain the string hwloc.

If there are a few of options try linking a few to the proper path and see if any of them work; I doubt you’ll break anything. If there’s only the two options you’ve already shown us, then you have to install the old version of hwloc. This would likely be done with your installation of Gromacs, but you would have to look at the contents of the tarball you downloaded with wget. If it’s not there then you may have to downgrade hwloc via your system package manager; I’m not familiar with the process for this in Google Colab, but I’m sure there are plenty of tutorials online.

Hope that helps,

–K

Answered By: Kibeth

I installed the package like this an it worked, thank you guys.

!wget https://download.open-mpi.org/release/hwloc/v1.11/hwloc-1.11.13.tar.gz

!tar xzf hwloc-1.11.13.tar.gz
!cd /content/hwloc-1.11.13
! /content/hwloc-1.11.13/configure
!make
!sudo make install
Answered By: Muzeita