Recognize Intel GPU as compatible
authorRoland Schulz <roland.schulz@intel.com>
Sat, 28 Apr 2018 06:24:58 +0000 (23:24 -0700)
committerSzilárd Páll <pall.szilard@gmail.com>
Thu, 27 Sep 2018 22:02:16 +0000 (00:02 +0200)
Note new hardware support in the user guide
Also enable I_PREFETCH by default

Fixes #2030

Change-Id: I9c3efe70df4d273e463bf49f5ae4f0959a590ebe

docs/release-notes/features.rst
docs/user-guide/mdrun-performance.rst
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/gpu_utils/gpu_utils_ocl.cpp
src/gromacs/hardware/gpu_hw_info.cpp
src/gromacs/hardware/gpu_hw_info.h
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp

index 7a9006b5c1c821c2502523328e6e9e5228b12e47..d6d5f285435a825c962ea74cc3b1c533d31310be 100644 (file)
@@ -9,3 +9,10 @@ it more difficult than needed to use them with our |Gromacs| tools. Also, the :r
 files needed for :ref:`gmx trjconv` to split up trajectories into frames corresponding
 to the clusters were not written. This adds support for writing this :ref:`index <ndx>` file
 as well as proper :ref:`PDB <pdb>` files.
+
+Intel integrated GPUs are now supported for GPU offload with OpenCL
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+On Intel CPUs with integrated GPUs, it is now possible to offload nonbonded tasks
+to the GPU the same way as offload is done to other GPU architectures.
+This can have performance benefits, in particular on modern desktop and mobile
+Intel CPUs this offload can give up to 20% higher simulation performance.
index b6b9ff16cb7f0b6c25dd522c522b6f644354bc82..5fa2f686e3f793bce8578152b1199b079a00aeb6 100644 (file)
@@ -969,8 +969,11 @@ TODO In future patch: any tips not covered above
 Running the OpenCL version of mdrun
 -----------------------------------
 
-The current version works with GCN-based AMD GPUs, and NVIDIA CUDA
-GPUs. Make sure that you have the latest drivers installed. For AMD GPUs,
+Currently supported hardware architectures are:
+- GCN-based AMD GPUs;
+- NVIDIA GPUs (with at least OpenCL 1.2 support);
+- Intel iGPUs.
+Make sure that you have the latest drivers installed. For AMD GPUs,
 the compute-oriented `ROCm <https://rocm.github.io/>`_ stack is recommended;
 alternatively, the AMDGPU-PRO stack is also compatible; using the outdated
 and unsupported `fglrx` proprietary driver and runtime is not recommended (but
@@ -979,6 +982,7 @@ In addition Mesa version 17.0 or newer with LLVM 4.0 or newer is also supported.
 For NVIDIA GPUs, using the proprietary driver is
 required as the open source nouveau driver (available in Mesa) does not
 provide the OpenCL support.
+TODO: add Intel driver recommendations
 The minimum OpenCL version required is |REQUIRED_OPENCL_MIN_VERSION|. See
 also the :ref:`known limitations <opencl-known-limitations>`.
 
index 15e467308f66bac62766e66a7bdde3f68bbc7cd1..3c0722c69d7156f91c652b0aebac36d62c5524e7 100644 (file)
@@ -783,9 +783,8 @@ void get_gpu_device_info_string(char *s, const gmx_gpu_info_t &gpu_info, int ind
 
     gmx_device_info_t *dinfo = &gpu_info.gpu_dev[index];
 
-    bool               bGpuExists =
-        dinfo->stat == egpuCompatible ||
-        dinfo->stat == egpuIncompatible;
+    bool               bGpuExists = (dinfo->stat != egpuNonexistent &&
+                                     dinfo->stat != egpuInsane);
 
     if (!bGpuExists)
     {
index 1936cc5937aad0f44131623a9eb37bd7e76433ae..68e74775cee0fa71fc8717d829f05601a1f03240 100644 (file)
@@ -42,6 +42,8 @@
 
 #include "gmxpre.h"
 
+#include "config.h"
+
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -107,13 +109,15 @@ static int is_gmx_supported_gpu_id(gmx_device_info_t *ocl_gpu_device)
         return egpuCompatible;
     }
 
-    /* Only AMD and NVIDIA GPUs are supported for now */
+    /* Only AMD, Intel, and NVIDIA GPUs are supported for now */
     switch (ocl_gpu_device->vendor_e)
     {
         case OCL_VENDOR_NVIDIA:
             return egpuCompatible;
         case OCL_VENDOR_AMD:
             return runningOnCompatibleOSForAmd() ? egpuCompatible : egpuIncompatible;
+        case OCL_VENDOR_INTEL:
+            return GMX_OCL_NB_CLUSTER_SIZE == 4 ? egpuCompatible : egpuIncompatibleClusterSize;
         default:
             return egpuIncompatible;
     }
@@ -356,11 +360,10 @@ void get_gpu_device_info_string(char *s, const gmx_gpu_info_t &gpu_info, int ind
         return;
     }
 
-    gmx_device_info_t  *dinfo = &gpu_info.gpu_dev[index];
+    gmx_device_info_t *dinfo = &gpu_info.gpu_dev[index];
 
-    bool                bGpuExists =
-        dinfo->stat == egpuCompatible ||
-        dinfo->stat == egpuIncompatible;
+    bool               bGpuExists = (dinfo->stat != egpuNonexistent &&
+                                     dinfo->stat != egpuInsane);
 
     if (!bGpuExists)
     {
index 6d25a62e67907713088b20e6b848d82f7d45b704..5705fde2a224419fc3a5184affde5043a412474d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,5 +47,5 @@
 /* Names of the GPU detection/check results (see e_gpu_detect_res_t in hw_info.h). */
 const char * const gpu_detect_res_str[egpuNR] =
 {
-    "compatible", "nonexistent", "incompatible", "insane"
+    "compatible", "nonexistent", "incompatible", "incompatible (please recompile with GMX_OCL_NB_CLUSTER_SIZE=4)", "insane"
 };
index c89b7984093fce263dc2c027e3e38fd33a867bdd..51e1d74c4e0b2f614e483f69c296c7ac950d6eeb 100644 (file)
@@ -50,7 +50,7 @@ struct gmx_device_info_t;
  * incompatible driver/runtime. */
 typedef enum
 {
-    egpuCompatible = 0,  egpuNonexistent,  egpuIncompatible, egpuInsane, egpuNR
+    egpuCompatible = 0,  egpuNonexistent,  egpuIncompatible, egpuIncompatibleClusterSize, egpuInsane, egpuNR
 } e_gpu_detect_res_t;
 
 /* Names of the GPU detection/check results */
index 0b931f6028e3573edb308f8418ce364d4f20d37e..29ce432bf0d2b33afd1295ce114ebb5db0a072e6 100644 (file)
@@ -700,12 +700,13 @@ void nbnxn_gpu_init(gmx_nbnxn_ocl_t          **p_nb,
 
     nbnxn_ocl_init_const(nb, ic, listParams, nbat);
 
-    /* Enable LJ param manual prefetch for AMD or if we request through env. var.
+    /* Enable LJ param manual prefetch for AMD or Intel or if we request through env. var.
      * TODO: decide about NVIDIA
      */
     nb->bPrefetchLjParam =
         (getenv("GMX_OCL_DISABLE_I_PREFETCH") == nullptr) &&
-        ((nb->dev_info->vendor_e == OCL_VENDOR_AMD) || (getenv("GMX_OCL_ENABLE_I_PREFETCH") != nullptr));
+        ((nb->dev_info->vendor_e == OCL_VENDOR_AMD) || (nb->dev_info->vendor_e == OCL_VENDOR_INTEL)
+         || (getenv("GMX_OCL_ENABLE_I_PREFETCH") != nullptr));
 
     /* NOTE: in CUDA we pick L1 cache configuration for the nbnxn kernels here,
      * but sadly this is not supported in OpenCL (yet?). Consider adding it if