Bioinformatics ReviewBioinformatics Review
Notification Show More
Font ResizerAa
  •  Home
  • Docking
  • MD Simulation
  • Tools
  • More Topics
    • Softwares
    • Sequence Analysis
    • Algorithms
    • Bioinformatics Programming
    • Bioinformatics Research Updates
    • Drug Discovery
    • Phylogenetics
    • Structural Bioinformatics
    • Editorials
    • Tips & Tricks
    • Bioinformatics News
    • Featured
    • Genomics
    • Bioinformatics Infographics
  • Community
    • BiR-Research Group
    • Community Q&A
    • Ask a question
    • Join Telegram Channel
    • Join Facebook Group
    • Join Reddit Group
    • Subscription Options
    • Become a Patron
    • Write for us
  • About Us
    • About BiR
    • BiR Scope
    • The Team
    • Guidelines for Research Collaboration
    • Feedback
    • Contact Us
    • Recent @ BiR
  • Subscription
  • Account
    • Visit Dashboard
    • Login
Font ResizerAa
Bioinformatics ReviewBioinformatics Review
Search
Have an existing account? Sign In
Follow US
MD SimulationSoftware

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

Dr. Muniba Faiza
Last updated: March 16, 2021 11:27 am
Dr. Muniba Faiza
Share
6 Min Read
Install gromacs with gpu acceleration
SHARE

GROMACS [1] is one of the most popular software in bioinformatics for molecular dynamic (MD) studies of macromolecules. We have provided different tutorials regarding MD simulation using GROMACS including its installation on Ubuntu. In this article, we will install GROMACS with GPU acceleration.

Contents
Getting StartedDownloading CUDA toolkitInstalling CUDA toolkitUpdating NVIDIA driversInstalling prerequisites for GROMACSDownloading RegressiontestsDownloading GROMACSInstalling GROMACS

For detailed instructions, read our previous article. If you want to install without GPU support, you can simply follow the steps mentioned in that article. In this tutorial, 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

Downloading CUDA toolkit

It might be possible that you have already NVIDIA CUDA drivers installed on your system. Therefore, it’s better to first remove them and then install the latest drivers, otherwise, it will give you errors. Open a terminal and type the following commands:

$ sudo apt-get remove --purge cuda-* libcuda* nvidia*

$ sudo apt-get remove --purge cuda-drivers libcuda* cuda-runtime* cuda-8-0 cuda-demo*

$ sudo apt-get autoremove --purge nvidia* cuda-drivers libcuda* cuda-runtime* cuda-8-0 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

Now select the latest version of the CUDA toolkit according to your system from here. Download the local run file using the following command. The run file contains every essential component to be installed. Change to the directory where you want to download the installer.

$ cd Downloads/

$ wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run

Installing CUDA toolkit

Since the CUDA toolkit is available for Ubuntu 16.04 onwards, therefore, make sure you have the compatible version of Ubuntu installed on your system. Now, copy & paste the following command to run the installer.

$ sudo sh cuda_11.1.1_455.32.00_linux.run

It will ask to create a password, enter, and confirm. It will take a few minutes to finish. After that, edit /etc/ld.so.conf file.

$ sudo gedit /etc/ld.so.conf

Now add the following path at the end of the file.

/usr/local/cuda-11.1/lib64

$ sudo ldconfig

Now install CUDA drivers. To avoid any error, don’t forget to write the last argument in the command (–override-driver-check).

$ sudo sh cuda_11.1.1_455.32.00_linux.run --silent --driver --override-driver-check

Updating NVIDIA drivers

It is necessary to update the NVIDIA drivers otherwise it will not recognize GPU during simulation even after configuration. Copy & paste the following commands.

$ sudo ubuntu-drivers autoinstall

$ sudo apt-get update

Installing prerequisites for GROMACS

  • Install openmpi from the repository using the following command:

$ sudo apt-get install libopenmpi-dev

$ sudo apt-get install openmpi-bin

$ sudo apt-get install mpi4py

If you have already installed GROMACS, then skip to the next step.

  • 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

It is better to download the regressiontests separately because most of the time it throws an error stating that “the location of the file has changed”. Copy and paste the following commands in your terminal:

$ cd Downloads/

$ wget http://gerrit.gromacs.org/download/regressiontests-2020.4.tar.gz

Now, extract the downloaded file,

$ tar xvzf regressiontests-2020.4.tar.gz

Downloading GROMACS

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

$ wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-2020.4.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. Let’s say, Downloads.

$ cd Downloads/

$ tar xvzf gromacs-2020.4.tar.gz

  • Now move inside the gromacs folder.

$ cd gromacs-2020.4/

  • 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=ON -DGMX_MPI=OFF -DREGRESSIONTEST_PATH=/your/pwd/path/here/Downloads/regressiontests-2020.4

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.

$ make check

$ sudo make install

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

$ 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!

TAGGED:CUDA OpenCLGPU supportGromacsinstallationubuntu
Share This Article
Facebook Copy Link Print
ByDr. Muniba Faiza
Follow:
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
3 Comments
  • yoatzinpt says:
    December 29, 2020 at 1:22 am

    Having trouble retrieving anything from de GROMACS website, does anyone know if it is down for the holidays or something?

    Cheers.

    Log in to Reply
  • Yoatzin Peñaflor says:
    January 1, 2021 at 11:21 pm

    Hi, just wanted to say that this electronical magazine has helped me a lot. I finally managed to install GROMACS with GPU acceletarion, with little previous ubuntu experience. The most troublesome part was the installation of the CUDA toolkit, as installation with your instructions was nos successfull, but other than that, all was smooth sailing.

    A small observation, though: in the cmake compilation of GROMACS there is a small error. with the instructions “$ sudo cmake .. -DGMX_BUILD_OWN_FFTW=OFF _DREGRESSIONTEST_DOWNLOAD=OFF -DMAKE_C_COMPILER=gcc -DGMX_GPU=ON -DGMX_MPI=OFF -DREGRESSIONTEST_PATH=/your/pwd/path/here/Downloads/regressiontests-2020.4″ It should be -DREGRESSIONTEST_DOWNLOAD=OFF” with a “-” symbol instead of a “_”.

    Cheers and greetings from Mexico!

    Log in to Reply
  • hannibaldr.lector@gmail.com says:
    December 15, 2021 at 6:46 am

    I had some difficulties, but it was not hurd to fix. And I really thankful for this article. It was my last hope. And now I have this GPU support, thanks to you!

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Starting in Bioinformatics? Do This First!
Starting in Bioinformatics? Do This First!
Tips & Tricks
[Editorial] Is it ethical to change the order of authors’ names in a manuscript?
Editorial Opinion
Installing bbtools on Ubuntu
[Tutorial] Installing BBTools on Ubuntu (Linux).
Sequence Analysis Software Tools
wes_data_analysis Whole Exome Sequencing (WES) Data visualization Toolkit
wes_data_analysis: Whole Exome Sequencing (WES) Data visualization Toolkit
Bioinformatics Programming GitHub Python

You Might Also Like

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

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

March 29, 2022
Cortex - genome analysis framework
GenomicsSoftware

How to install Cortex on Ubuntu?

December 21, 2020
OVarFlow- A GATK4-based variant calling workflow
SoftwareTools

OVarFlow- A GATK4-based variant calling workflow

October 3, 2021
Installing tophat2 on Ubuntu
RNA-seq analysisSoftwareTools

Installing TopHat2 on Ubuntu

March 12, 2021
Copyright 2024 IQL Technologies
  • Journal
  • Customer Support
  • Contact Us
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Cookie Policy
  • Sitemap
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?

Not a member? Sign Up