Connect with us

Software

Method-2: Installing GROMACS on Ubuntu 20.04 with CUDA GPU Support

Dr. Muniba Faiza

Published

on

Installing GROMACS on Ubuntu 20.04 with CUDA GPU Support

We have provided a tutorial on installing GROMACS [1] on Ubuntu with CUDA GPU support. The methods may vary depending on the requirements of your system. Therefore, in this article, we provide another method to configure GROMACS with CUDA.

If you want to install GROMACS without GPU acceleration, read our previous article. Here, you will find some additional steps for GPU acceleration.

Getting Started

It is good practice to update your repository information and software packages before installing new programs. Open a terminal by pressing Ctrl+Alt+T and type:

$ sudo apt-get update

$ sudo apt-get upgrade

Removing existing drivers

It might be possible that some NVIDIA drivers have already been installed on your system. Therefore, it is better to remove them first otherwise it will give errors during the installation of the toolkit and drivers. You can check for the existing drivers using the following command:

$ nvidia-smi

It will list all NVIDIA drivers existing in your system.

Now, let’s remove them using the following commands:

$ sudo apt-get purge nvidia*

$ sudo apt-get autoremove

$ sudo apt-get autoclean

Now, rerun the $ nvidia-smi command to check whether you have completely removed the drivers. If not, then run the following commands as well. Remember to note the CUDA version (here, Cuda-9.2).

$ sudo apt-get autoremove --purge nvidia* cuda-drivers libcuda* cuda-runtime* cuda-9-2 cuda-demo*

$ sudo apt-get remove --purge nvidia* cuda-drivers libcuda1-396 cuda-runtime-9-2 cuda-9.2 cuda-demo-suite-9-2 cuda

$ sudo apt-get autoremove

$ sudo apt-get autoclean

Now, check again using $ nvidia-smi. All NVIDIA drivers must have been cleared.

Downloading CUDA toolkit

Now select the latest version of the CUDA toolkit according to your system from here. In our last tutorial, we installed the toolkit using a local run file that did not work on some systems. Therefore, in this tutorial, we will install using a local deb file.

First, we will download the CUDA repository. Now, change to the directory where you want to download the files.

$ cd Downloads/

$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin

Now move the downloaded file to the repository using the following command.

$ sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600

Now, download the deb file of the toolkit using the following command.

$ wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda-repo-ubuntu2004-11-2-local_11.2.2-460.32.03-1_amd64.deb

Installing CUDA toolkit

Extract the downloaded file and then install using the following commands.

$ sudo dpkg -i cuda-repo-ubuntu2004-11-2-local_11.2.2-460.32.03-1_amd64.deb

$ sudo apt-key add /var/cuda-repo-ubuntu2004-11-2-local/7fa2af80.pub

$ sudo apt-get update

$ sudo apt-get -y install cuda

The CUDA toolkit must be installed successfully on your system. If it still doesn’t, then use the following command:

$ sudo apt-get -y install nvidia-cuda-toolkit

Installing NVIDIA drivers

Remember CUDA 11.2 is compatible with >= 450.80.02 NVIDIA driver version. We will install NVIDIA 460 and then update the version.

$ sudo apt-get install nvidia-driver-460

$ sudo ubuntu-drivers autoinstall

$ sudo apt-get update

Now, check for the NVIDIA drivers using the following command, it should display the version.

$ nvcc --version

and run $ nvidia-smi. It should display NVIDIA drivers and CUDA version along with other information.

Installing prerequisites for GROMACS

  • Install openmpi from the repository using the following command. If you have already installed GROMACS, then skip to the next step.

$ sudo apt-get install libopenmpi-dev

$ sudo apt-get install openmpi-bin

$ sudo apt-get install -y python3-mpi4py

  • Get cmake before installing GROMACS. In the terminal, type:

$ sudo apt-get install -y cmake

After the installation finishes, you can check the version of cmake by the following command:

$ cmake --version

If it displays the version, then it means everything is fine. Move on to the next step.

  • The next requirement is build-essential. To install this, type the following command in the terminal:

$ sudo apt-get install -y build-essential

  • Now, you need the FFTW3 library. Install it using the following command:

$ sudo apt-get install -y libfftw3-dev

  • Now, install Doxygen

$ sudo apt-get install -y doxygen

Downloading Regressiontests

Download the latest release of regressiontests from here or use the following command. Change to the directory where you want to download the GROMACS software and paste the following commands.

$ cd Downloads/

$ wget https://ftp.gromacs.org/regressiontests/regressiontests-2020.6.tar.gz

Now, extract the downloaded file,

$ tar xvzf regressiontests-2020.6.tar.gz

Downloading GROMACS

Download the latest release of GROMACS from here or use the following command.

$ wget https://ftp.gromacs.org/gromacs/gromacs-2020.6.tar.gz

Installing GROMACS

First, get your pwd path using the following command.

$ pwd

Note down the displayed path, we will need it in later steps.

  • Extract the downloaded archive file. Move inside the directory where you have downloaded the package. (We are still in the Downloads directory).

$ tar xvzf gromacs-2020.6.tar.gz

  • Now move inside the gromacs folder.

$ cd gromacs-2020.6/

  • Create a directory called “build-gpu” where we will keep our compiled binaries.

$ mkdir build-gpu

  • Move inside the build-gpu directory.

$ cd build-gpu/

  • Now, make gromacs using cmake.

$ sudo cmake .. -DGMX_BUILD_OWN_FFTW=OFF -DREGRESSIONTEST_DOWNLOAD=OFF -DMAKE_C_COMPILER=gcc -DGMX_GPU=CUDA -DGMX_MPI=OFF -DREGRESSIONTEST_PATH=/your/pwd/path/here/Downloads/regressiontests-2020.6

NOTE

You may get an error during the compilation stating that the NVCC/C++ version is not compatible or some error similar to that. For that, you need to downgrade the GCC version. For now, it would be the latest version (9.2) installed on your system. You have to install version 8, follow the steps given below.

$ sudo apt-get -y install gcc-8 g++-8

$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8

$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8

$ sudo update-alternatives --config gcc

$ sudo update-alternatives --config g++

Check the current version,

$ gcc --version

$ g++ --version

Now, you can continue with the cmake command:

$ sudo cmake .. -DGMX_BUILD_OWN_FFTW=OFF -DREGRESSIONTEST_DOWNLOAD=OFF -DMAKE_C_COMPILER=gcc -DGMX_GPU=CUDA -DGMX_MPI=OFF -DREGRESSIONTEST_PATH=/your/pwd/path/here/Downloads/regressiontests-2020.6

If everything goes well, the message in your terminal will say “Generating Done. Build files written… “. If not, ensure you have replaced the pwd path in the command with the path of your home directory.

  • Now, let’s check and make.

$ sudo make check

$ sudo make install

  • Move inside the unpacked regressiontests directory and execute the following command:

$ cd regressiontests-2020.6/

$ source /usr/local/gromacs/bin/GMXRC

After that, you can check for the successful installation of GROMACS with the following command:

$ gmx pdb2gmx --version

It will display the GPU version as well.

Enjoy the speedy simulation!


References

  1. Abraham, M. J., Murtola, T., Schulz, R., Páll, S., Smith, J. C., Hess, B., & Lindahl, E. (2015). GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers. SoftwareX1, 19-25.

Further Reading

Method-1: Installing GROMACS on Ubuntu with CUDA GPU Support

Installing Gromacs on Ubuntu for MD Simulation

Tutorial: Molecular dynamics (MD) simulation using Gromacs

Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba

Docking

[Tutorial] Performing docking using DockingPie plugin in PyMOL.

Dr. Muniba Faiza

Published

on

[Tutorial] Performing docking using DockingPie plugin in PyMOL.

DockingPie [1] is a PyMOL plugin to perform computational docking within PyMOL [2]. In this article, we will perform simple docking using DockingPie1.2.

(more…)

Continue Reading

Docking

How to install the DockingPie plugin on PyMOL?

Dr. Muniba Faiza

Published

on

How to install DockingPie plugin on PyMOL?

DockingPie [1] is a plugin of PyMOL [2] made to fulfill the purpose of docking within the PyMOL interface. This plugin will allow you to dock using four different algorithms, namely, Vina, RxDock, SMINA, and ADFR. It will also allow you to perform flexible docking. Though the installation procedure is the same for all OSs, in this article, we are installing this plugin on Ubuntu (Linux).

(more…)

Continue Reading

Software

Video Tutorial: Calculating binding pocket volume using PyVol plugin.

Dr. Muniba Faiza

Published

on

Calculate Binding Pocket Volume in Pymol (using PyVol plugin).

This is a video tutorial for calculating binding pocket volume using the PyVol plugin [1] in Pymol [2].

(more…)

Continue Reading

Software

How to generate topology from SMILES for MD Simulation?

Dr. Muniba Faiza

Published

on

How to generate topology from SMILES for MD Simulation?

If you need to generate the topology of molecules using their SMILES, a simple Python script is available.

(more…)

Continue Reading

Software

[Tutorial] Installing jdock on Ubuntu (Linux).

Dr. Muniba Faiza

Published

on

[Tutorial] Installing jdock on Ubuntu (Linux).

jdock is an extended version of idock [1]. It has the same features as the idock along with some bug fixes. However, the binary name and the GitHub repository names are changed. We are installing jdock on Ubuntu (Linux).

(more…)

Continue Reading

Software

How to upgrade cmake on Ubuntu (Linux)?

Dr. Muniba Faiza

Published

on

How to upgrade cmake on Ubuntu/Linux?

In bioinformatics, cmake is used to install multiple software including GROMACS, jdock, and so on. Here is a short tutorial on how to upgrade cmake on Ubuntu and get rid of the previous version. (more…)

Continue Reading

Software

How to install GMXPBSA on Ubuntu (Linux)?

Dr. Muniba Faiza

Published

on

How to install GMXPBSA on Ubuntu (Linux)?

GMXPBSA is a tool to calculate binding free energy [1]. It is compatible with Gromacs version 4.5 and later. In this article, we will install GMXPBSA version 2.1.2 on Ubuntu (Linux).

(more…)

Continue Reading

Docking

[Tutorial] Installing Pyrx on Windows.

Dr. Muniba Faiza

Published

on

[Tutorial] Installing Pyrx on Windows.

Pyrx [1] is another virtual screening software that also offers to perform docking using Autodock Vina. In this article, we will install Pyrx on Windows. (more…)

Continue Reading

MD Simulation

How to solve ‘Could NOT find CUDA: Found unsuitable version “10.1”‘ error during GROMACS installation?

Dr. Muniba Faiza

Published

on

How to solve ‘Could NOT find CUDA: Found unsuitable version “10.1”‘ error during GROMACS installation?

Compiling GROMACS [1] with GPU can be trivial. Previously, we have provided a few articles on the same. In this article, we will solve an error frequently occurring during GROMACS installation.

(more…)

Continue Reading

Software

Installing Autodock4 on MacOS.

Dr. Muniba Faiza

Published

on

Installing Autodock4 on MacOS

Previously, we installed the Autodock suite [1] on Ubuntu. Visit this article for details. Now, let’s install it on MacOS.

(more…)

Continue Reading

Docking

How to install Autodock4 on Ubuntu?

Dr. Muniba Faiza

Published

on

How to install Autodock4 on Ubuntu?

Autodock suite is used for docking small molecules [1]. Recently, Autodock-GPU [2] is developed to accelerate the docking process. Its installation is described in this article. In this tutorial, we will install Autodock 4.2.6 on Ubuntu.

(more…)

Continue Reading

Software

DS Visualizer: Uses & Applications

Dr. Muniba Faiza

Published

on

DS Visualizer: Uses & Applications

Discovery Studio (DS) Visualizer (from BIOVIA) is a visualization tool for viewing, sharing, and analyzing proteins [1]. Here are some uses and applications of DS Visualizer.

(more…)

Continue Reading

Software

Protein structure & folding information exploited from remote homologs.

Dr. Muniba Faiza

Published

on

protein structure & folding prediction using remote homologs

Remote homologs are similar protein structures that share similar functions, but there is no easily detectable sequence similarity in them. A new study has revealed that the protein folding information can be exploited from remote homologous structures. A new tool is developed to recognize such proteins and predict their structure and folding pathway. (more…)

Continue Reading

RNA-seq analysis

Pathonoia- A new tool to detect pathogens in RNA-seq data.

Dr. Muniba Faiza

Published

on

Pathonoia- A new tool to detect pathogens in RNA-seq data.

Detecting viruses and bacteria in RNA-seq data with less false positive rate is a difficult task. A new tool is introduced to detect pathogens in RNA-seq data with high precision and recall known as Pathonoia [1].

(more…)

Continue Reading

Software

AlphaFill- New algorithm to fill ligands in AlphaFold models.

Dr. Muniba Faiza

Published

on

AlphaFill- New algorithm to fill ligands in AlphaFold models.

AlphaFold is a popular artificial intelligence based protein prediction tool [1]. Though it predicts good protein structures, it lacks the capability to predict the small molecules present in the structure such as ligands. For this purpose, AlphaFill is introduced by Hekkelman et al.,[2]. (more…)

Continue Reading

Software

How to calculate binding pocket volume using PyVol plugin in PyMol?

Dr. Muniba Faiza

Published

on

How to calculate binding pocket volume using PyVol plugin in PyMol?

Previously, we provided a tutorial for PyVol plugin [1] installation. In this article, we will calculate the binding pocket volume of protein using the same plugin in PyMol [2]. (more…)

Continue Reading

Software

How to generate electron density map using Pymol?

Dr. Muniba Faiza

Published

on

How to generate electron density map using Pymol?

Electron density maps are available for most of the protein structures in PDB. Therefore, in this article, we are using PDB to generate electron density maps in Pymol.

(more…)

Continue Reading

Software

Installing PyVOL plugin in Pymol on Ubuntu (Linux).

Dr. Muniba Faiza

Published

on

Installing PyVOL plugin in Pymol on Ubuntu (Linux).

PyVOL [1] is an excellent plugin of Pymol [2] for pocket visualization of proteins. In this article, we will install the PyVOL plugin in Pymol on Ubuntu. (more…)

Continue Reading

Software

How to execute matlab from terminal in Ubuntu (Linux)?

Dr. Muniba Faiza

Published

on

How to execute matlab from terminal in Ubuntu (Linux)?

While trying to install Matlab [1], it generally gives an error stating “matlab: command not found.”. Here, we provide a solution to this error.

(more…)

Continue Reading

Software

How to install Kpax on Ubuntu (Linux)?

Published

on

How to install Kpax on Ubuntu (Linux)?

Kpax is a bioinformatics program to search and align protein structures [1]. It is currently available for Linux platforms only. In this article, we are going to install the latest version of Kpax (5.1.3) on Ubuntu (Linux). (more…)

Continue Reading

LATEST ISSUE

ADVERT