GROMACS 5.0.x CUDA/GPU Detection Failure With Ubuntu 14.04 nVidia 331.113 Update – Fix With An apt-get

If not for the near-20x speedup I've achieved running GROMACS on an nVidia GTX 770 Classified over an Intel i7 Extreme 6-core, nVidia in Ubuntu would almost be more trouble than its worth. The initial installation of the nVidia drivers from the nVidia website works, then the first time Ubuntu auto-updates the drivers to the latest-and-greatest, you're never entirely sure what the next boot is going to look like – usually a black screen at best. And, if you found this page while looking for a solution to the nVidia driver update black/blank screen, my solution (which has worked without issue to date) is to ditch lightdm and use the GNOME Display Manager (gdm) instead (this apparently appears to be a theme with Ubuntu 14.04 installs on SSD drives as well).

sudo apt-get install gdm

Now, with that settled, the latest update (331.113) broke my GROMACS GPU install (performed using the steps outlined at: GROMACS 5.0.1, nVidia CUDA Toolkit, And FFTW3 Under Ubuntu 14.04 LTS (64-bit); The Virtues Of VirtualBox). The error for my system looks as follows:

GROMACS:      gmx mdrun, VERSION 5.0.1
Executable:   /opt/gromacs_gpu/bin/gmx
Library dir:  /opt/gromacs_gpu/share/gromacs/top
Command line:
  gmx mdrun -v -deffnm RUN_solv_em -s RUN_ions.tpr -o RUN_em.trr -gpu_id 0


NOTE: Error occurred during GPU detection:
      unknown error
      Can not use GPU acceleration, will fall back to CPU kernels.

Reading file RUN_ions.tpr, VERSION 5.0.1 (single precision)
Using 1 MPI thread
Using 12 OpenMP threads 

That said, nvidia-smi sees all three cards in my system just fine.

+------------------------------------------------------+                       
| NVIDIA-SMI 331.113    Driver Version: 331.113        |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 650     Off  | 0000:01:00.0     N/A |                  N/A |
| 21%   30C  N/A     N/A /  N/A |    183MiB /  1023MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 770     Off  | 0000:02:00.0     N/A |                  N/A |
| 35%   29C  N/A     N/A /  N/A |      9MiB /  4095MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
|   2  GeForce GTX 770     Off  | 0000:03:00.0     N/A |                  N/A |
| 35%   25C  N/A     N/A /  N/A |      9MiB /  4095MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Compute processes:                                               GPU Memory |
|  GPU       PID  Process name                                     Usage      |
|=============================================================================|
|    0            Not Supported                                               |
|    1            Not Supported                                               |
|    2            Not Supported                                               |
+-----------------------------------------------------------------------------+

Concerned that this might be some kind of issue with the drivers and my compiled version of 5.0.1, I compiled a copy of 5.0.4 using the same build parameters in cmake. The result? Same problem.

The simple solution (which may apply to all things OpenCL as well, but my concern was simply GROMACS) is to install nvidia-modprobe.

sudo apt-get install nvidia-modprobe

Whatever happened in the install, GROMACS now sees the GPU cards just fine.

GROMACS:      gmx mdrun, VERSION 5.0.4
Executable:   /opt/gromacs_gpu_504/bin/gmx
Library dir:  /opt/gromacs_gpu_504/share/gromacs/top
Command line:
  gmx mdrun -v -deffnm RUN_solv_em -s RUN_ions.tpr -o RUN_em.trr -gpu_id 0

Reading file RUN_md.tpr, VERSION 5.0.4 (single precision)

Using 1 MPI thread
Using 12 OpenMP threads 

3 GPUs detected:
  #0: NVIDIA GeForce GTX 770, compute cap.: 3.0, ECC:  no, stat: compatible
  #1: NVIDIA GeForce GTX 650, compute cap.: 3.0, ECC:  no, stat: compatible
  #2: NVIDIA GeForce GTX 770, compute cap.: 3.0, ECC:  no, stat: compatible

0 GPU user-selected for this run.
Mapping of GPU to the 1 PP rank in this node: #0

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.