Downlaod VMD from the software download page here
Extract the vmd-1.9.3.bin.LINUXAMD64-CUDA8-OptiX4-OSPRay111p1.opengl.tar.gz file to vmd-1.9.3 and change directory.
$ cd /path/to/file/vmd-1.9.3
Run configure to see list of options available
$ ./configure
Run configure to select the options
$ ./configure LINUXAMD64 OPENGL TK CUDA TCL PYTHON NUMPY
Change directory to src
$ cd src
Install
$ sudo make install
$ sudo apt install gcc
tar xzvf cmake-3.12.2.tar.gz
cd cmake-3.12.2/
./bootstrap
make -j 4
sudo make install
Verify the GPU is CUDA capable
$ lspci | grep -i nvidia
Check if the Ubuntu version is supported by CUDA toolkit
$ uname -m && cat /etc/*release
Check the GCC version currently installed
$ gcc --version
Check the kernel version
$ uname -r
Install kernel headers
$ sudo apt-get install linux-headers-$(uname -r)
Download the base installer from NVIDIA download page and install
Linux _ x86_64 _ Ubuntu _ 18.04 _ deb(network)
$ sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
Install CUDA repository GPG key
$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
Update
sudo apt-get update
Install CUDA
$ sudo apt-get install cuda
To permanently add CUDA to the path
$ vi ~/.bashrc
Add path:
export PATH=/usr/local/cuda-10.0/bin:PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
Check installation by entering in terminal
$ nvcc -V
$ cat /proc/driver/nvidia/version
Reboot
Test
$ cp -r /usr/local/cuda-10.0/samples/ ./
$ cd samples/1_Utilities/deviceQuery/
$ make
$ ./deviceQuery
Result should be PASS
After installing required softwares such as gcc compiler, cmake, fftw and optional packages like CUDA, MPI, etc.
Download GROMACS package from official site
Extract the contents of downloaded file
cd gromacs-2016.4/
mkdir build
cd build/
cmake .. -DGMX_GPU=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.0/ -DGMX_BUILD_OWN_FFTW=ON _DREGRESSIONTEST_DOWNLOAD=ON _DCMAKE_INSTALL_PREFIX=/usr/local/gromacs16
make -j 4
sudo make install
export PATH=/usr/local/gromacs16/bin:$PATH
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX=/usr/local/gromacs20 -DREGRESSIONTEST_PATH=/home/raviteja/Downloads/regressiontests-2020