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

Software

[Tutorial] How to install 3Dmapper on Ubuntu (Linux)?

Dr. Muniba Faiza

Published

on

Installing 3Dmapper on Ubuntu (Linux).

Understanding the relationship between genes and proteins is crucial for elucidating biological processes, and disease mechanisms, and developing targeted therapies. A new tool developed by Yang et. al., [1], provides a better solution to map annotated positions and variants to protein structures automatically. 3Dmapper is a stand-alone tool based on R and Python programming languages that map annotated genomic variants or positions to protein structures [1]. In this article, we will install 3Dmapper on Ubuntu (Linux).

(more…)

Continue Reading

Software

CMake installation and upgrade: What worked & what didn’t?!

Dr. Muniba Faiza

Published

on

CMake installation and upgrade: What worked & what didn’t?!

CMake is a widely used cross-platform build system that automates the process of compiling and linking software projects. In bioinformatics, CMake can be utilized to manage the build process of software tools and pipelines used for data analysis, algorithm implementation, and other computational tasks. However, managing the versions of CMake or upgrading it on Ubuntu (Linux) can be a trivial task for beginners. In this article, we provide methods for installing and upgrading CMake on Ubuntu.

(more…)

Continue Reading

Bioinformatics Programming

Free_Energy_Landscape-MD: Python package to create Free Energy Landscape using PCA from GROMACS.

Dr. Muniba Faiza

Published

on

In molecular dynamics (MD) simulations, a free energy landscape (FEL) serves as a crucial tool for understanding the behavior of molecules and biomolecules over time. It is difficult to understand and plot a meaningful FEL and then extract the time frames at which the plot shows minima. In this article, we introduce a new Python package (Free_Energy_Landscape-MD) to generate an FEL based on principal component analysis (PCA) from MD simulation done by GROMACS [1].

(more…)

Continue Reading

Bioinformatics News

VS_Analysis: A Python package to perform post-virtual screening analysis

Dr. Muniba Faiza

Published

on

VS_Analysis: A Python package to perform post-virtual screening analysis

Virtual screening (VS) is a crucial aspect of bioinformatics. As you may already know, there are various tools available for this purpose, including both paid and freely accessible options such as Autodock Vina. Conducting virtual screening with Autodock Vina requires less effort than analyzing its results. However, the analysis process can be challenging due to the large number of output files generated. To address this, we offer a comprehensive Python package designed to automate the analysis of virtual screening results.

(more…)

Continue Reading

Bioinformatics Programming

vs_interaction_analysis.py: Python script to perform post-virtual screening analysis

Dr. Muniba Faiza

Published

on

vs_interaction_analysis.py: Python script to perform post-virtual screening analysis

Analyzing the results of virtual screening (VS) performed with Autodock Vina [1] can be challenging when done manually. In earlier instances, we supplied two scripts, namely vs_analysis.py [2,3] and vs_analysis_compounds.py [4]. This time, we have developed a new Python script to simplify the analysis of VS results.

(more…)

Continue Reading

Software

How to install Interactive Genome Viewer (IGV) & tools on Ubuntu?

Dr. Muniba Faiza

Published

on

How to install Interactive Genome Viewer (IGV) & tools on Ubuntu?

Interactive Genome Viewer (IGV) is an interactive tool to visualize genomic data [1]. In this article, we are installing IGV and tools on Ubuntu desktop.

(more…)

Continue Reading

MD Simulation

[Tutorial] Installing VIAMD on Ubuntu (Linux).

Dr. Muniba Faiza

Published

on

[Tutorial] Installing VIAMD on Ubuntu (Linux).

Visual Interactive Analysis of Molecular Dynamics (VIAMD) is a tool that allows the interactive analysis of molecular dynamics simulations [1]. In this article, we are installing it on Ubuntu (Linux).

(more…)

Continue Reading

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

LATEST ISSUE

ADVERT