Connect with us

Software

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

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 upon 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.

At 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 up, 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 into 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 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, make sure you have replaced the pwd path in 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

How to install Autodock4 on Ubuntu?

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

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.

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.

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.

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?

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?

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).

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)?

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

Secondary structure

How to run do_dssp command (mkdssp) in Gromacs 2022?

Published

on

How to run do_dssp command in Gromacs 2022?

In the latest version of GROMACS (2022) [1], there are some issues regarding the gmx do_dssp command. Apparently, this command either does not run displaying a fatal error, or if it runs then it does not read any frame from MD simulation files. In this article, we are going to run the same command for GROMACS 2022. (more…)

Continue Reading

Software

Installing SMINA on Ubuntu (Linux).

Published

on

Installing SMINA on Ubuntu (Linux)

SMINA is a fork of AutoDock Vina supporting better scoring function and high-performance energy minimization [1]. In this article, we are going to install SMINA on Ubuntu (Linux). (more…)

Continue Reading

Software

How to install ClusCo on Ubuntu (Linux)?

Published

on

How to install ClusCo on Ubuntu (Linux)?

ClusCo is a bioinformatics software to perform clustering and comparison of protein models [1]. In this article, we are going to install ClusCo on Ubuntu (Linux). (more…)

Continue Reading

Software

How to run LigAlign plugin on Pymol?

Published

on

How to run LigAlign plugin on Pymol?

Running a plugin on an old version of Pymol [1] can give you multiple errors that are not easy to troubleshoot. For example, LigAlign plugin [2] runs on an old version of Pymol. Previously, we explained how to install LigAlign on Pymol. In this article, we will run the LigAlign command on Pymol. (more…)

Continue Reading

Software

How to install the LigAlign plugin on Pymol on Ubuntu (Linux)?

Published

on

How to install the LigAlign plugin on Pymol on Ubuntu (Linux)?

Few errors appear when we try to run the LigAlign plugin [1] in Pymol [2]. For example, if you try to run the ligand_alignment plugin, it will give you multiple errors including “Unable to initialize LigAlign v1.00“, or “can’t run LigAlign v1.00” or “incorrect Python syntax” or “Plugin has been installed but initialization failed“. In this article, we explain the reason for this issue and how you can rectify these errors. (more…)

Continue Reading

Software

How to install multiple Pymol versions on Ubuntu (Linux)?

Published

on

Installing multiple versions of Pymol on Ubuntu

Sometimes we need to access old versions of Pymol [1]. Running some plugins on Pymol is difficult due to Python incompatibility. New Pymol versions require Python 3.x whereas older versions run on Python 2.x. Therefore, we need to maintain multiple versions of Pymol on a single system. In this article, we will install Pymol 1.7.x along with the latest version (Pymol 2.5.2) on Ubuntu. Later, we will create shortcuts for them.

(more…)

Continue Reading

Software

[Tutorial] Installing Pymol on Mac OS.

Published

on

installing pymol on mac os

Previously, we provided a tutorial for Pymol installation on Ubuntu. In this article, we are going to install Pymol on Mac OS. (more…)

Continue Reading

Software

How to install VMD on Ubuntu?

Published

on

How to install VMD on Ubuntu?

In this article, we are going to install VMD [1] on Ubuntu. (more…)

Continue Reading

MD Simulation

How to install GROMACS on Apple M1 (MacOS)?

Published

on

Installing GROMACS on Apple M1 (MacOS)

We have provided a few articles on GROMACS installation on Ubuntu. In this article, we are going to install GROMACS [1] on Mac OS. (more…)

Continue Reading

Software

PyMol: Uses & Applications

Published

on

PyMol: Uses & Applications

PyMol is one of the most widely used bioinformatics software. Generally, it is used as a molecular viewer to visualize macromolecules and small molecules. In this article, we are discussing several uses and applications of PyMol. (more…)

Continue Reading

LATEST ISSUE

ADVERT