# GROMACS SYCL for Intel GPU support

**URL:** <https://gromacs.bioexcel.eu/t/gromacs-sycl-for-intel-gpu-support/9715>\
**Category:** User discussions\
**Tags:** mdrun, gpu, installation\
**Created:** [July 23, 2024, 8:52am UTC](https://gromacs.bioexcel.eu/t/gromacs-sycl-for-intel-gpu-support/9715 "2024-07-23T08:52:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![UserMIR1](https://avatars.discourse-cdn.com/v4/letter/u/35a633/32.png) [@UserMIR1](https://gromacs.bioexcel.eu/u/UserMIR1)\
**Post date:** [July 23, 2024, 8:52am UTC](https://gromacs.bioexcel.eu/t/gromacs-sycl-for-intel-gpu-support/9715/1 "2024-07-23T08:52:11Z")

</div>

GROMACS version:2024.2  
GROMACS modification: Yes/No  
I recently installed GROMACS with SYCL GPU acceleration for Intel GPUs (UHD graphics 620). I was wondering, is there a command I need to input to run MD simulations using GPU support?

 ![Screenshot 2024-07-23 114250](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/8/8b5f53c727aea1d2cbca1da48239f79c6f8c6d42.png)

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [July 23, 2024, 4:01pm UTC](https://gromacs.bioexcel.eu/t/gromacs-sycl-for-intel-gpu-support/9715/2 "2024-07-23T16:01:12Z")

</div>

Hi!

GROMACS should use the GPU automatically when possible (if drivers are installed: can be checked by running `sycl-ls`). You can look at the `gmx mdrun` output to make sure GPU offload is used: you should see something like the following:

```auto
1 GPU selected for this run.
Mapping of GPU IDs to the 1 GPU task in the 1 rank on this node:
  PP:0
PP tasks will do (non-perturbed) short-ranged interactions on the GPU

```

You can see how to control which parts are offloaded to the GPU in the [user guide](https://manual.gromacs.org/2024.2/user-guide/mdrun-performance.html#running-mdrun-with-gpus). You might get better performance by setting `-nb gpu -pme cpu` to force PME computation back to the CPU (it prefers GPU by default), since your integrated GPU is not very powerful.

---

<div class="post-metadata">

**Author:** ![UserMIR1](https://avatars.discourse-cdn.com/v4/letter/u/35a633/32.png) [@UserMIR1](https://gromacs.bioexcel.eu/u/UserMIR1)\
**Post date:** [July 23, 2024, 5:15pm UTC](https://gromacs.bioexcel.eu/t/gromacs-sycl-for-intel-gpu-support/9715/3 "2024-07-23T17:15:24Z")

</div>

Good Day.  
Thank you for the response. I did my MD simulation in the oneAPI environment. Upon running sycl -ls, I got the following:  
[opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Core™ i5-8250U CPU @ 1.60GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02\_160000]

However when running the MD simulation, the md.log file seems to indicate that there is no compatible GPU.

GROMACS: gmx mdrun, version 2024.2  
Executable: /usr/local/bin/gmx  
Data prefix: /usr/local  
Working dir: /mnt/c/Users/HP/Documents/gromacs  
Process ID: 451  
Command line:  
gmx mdrun -deffnm md\_0\_10 -v

GROMACS version: 2024.2  
Precision: mixed  
Memory model: 64 bit  
MPI library: thread\_mpi  
OpenMP support: enabled (GMX\_OPENMP\_MAX\_THREADS = 128)  
GPU support: SYCL (DPCPP)  
NBNxM GPU setup: super-cluster 2x2x2 / cluster 4  
SIMD instructions: AVX2\_256  
CPU FFT library: Intel MKL version 2024.0.2 Build 20240605  
GPU FFT library: Intel MKL version 2024.0.2 Build 20240605  
Multi-GPU FFT: none  
RDTSCP usage: enabled  
TNG support: enabled  
Hwloc support: disabled  
Tracing support: disabled  
C compiler: /opt/intel/oneapi/compiler/2024.2/bin/icx IntelLLVM 2024.2.0  
C compiler flags: -mavx2 -mfma -Wno-missing-field-initializers  
C++ compiler: /opt/intel/oneapi/compiler/2024.2/bin/icpx IntelLLVM 2024.2.0  
C++ compiler flags: -mavx2 -mfma -Wno-reserved-identifier -Wno-missing-field-initializers -Wno-pass-failed -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-source-uses-openmp -Wno-c++17-extensions -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-switch-enum -Wno-switch-default -Wno-extra-semi-stmt -Wno-weak-vtables -Wno-shadow -Wno-padded -Wno-reserved-id-macro -Wno-double-promotion -Wno-exit-time-destructors -Wno-global-constructors -Wno-documentation -Wno-format-nonliteral -Wno-used-but-marked-unused -Wno-float-equal -Wno-cuda-compat -Wno-conditional-uninitialized -Wno-conversion -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-unsafe-buffer-usage -Wno-cast-function-type-strict -fiopenmp  
BLAS library: Intel MKL version 2024.0.2 Build 20240605  
LAPACK library: Intel MKL version 2024.0.2 Build 20240605  
SYCL compiler flags: -fsycl -fsycl-device-code-split=per\_kernel -ffast-math -Wno-incorrect-sub-group-size -DSYCL2020\_DISABLE\_DEPRECATION\_WARNINGS  
SYCL linker flags: -fsycl -fsycl-device-code-split=per\_kernel  
SYCL DPC++ version: 20240602 (libsycl 7.2.0)

Running on 1 node with total 4 cores, 8 processing units, 0 compatible GPUs  
Hardware detected on host DESKTOP-PBXXXXX:  
CPU info:  
Vendor: Intel  
Brand: Intel(R) Core™ i5-8250U CPU @ 1.60GHz  
Family: 6 Model: 142 Stepping: 10  
Features: aes apic avx avx2 clfsh cmov cx8 cx16 f16c fma htt intel lahf mmx msr pcid pclmuldq pdpe1gb popcnt pse rdrnd rdtscp sse2 sse3 sse4.1 sse4.2 ssse3  
Hardware topology: Basic  
Packages, cores, and logical processors:  
[indices refer to OS logical processors]  
Package 0: [0 1] [2 3] [4 5] [6 7]  
CPU limit set by OS: -1 Recommended max number of threads: 8  
Does this mean that the somehow the integrated GPU is in use but is not indicated explicitly ?

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [July 23, 2024, 6:21pm UTC](https://gromacs.bioexcel.eu/t/gromacs-sycl-for-intel-gpu-support/9715/4 "2024-07-23T18:21:21Z")

</div>

> [@UserMIR1](#):
>
> Upon running sycl -ls, I got the following:  
> [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Core™ i5-8250U CPU @ 1.60GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02\_160000]

This only detects CPU, no GPU (while it is integrated in the same physical package, it is a separate OpenCL device). Looks like you need to install the GPU OpenCL runtime; on Ubuntu, it’s `sudo apt install intel-opencl-icd`.

If all works well, you should have both CPU and GPU, like this:

```console
$ sycl-ls
[opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000]
[opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) HD Graphics 530 OpenCL 3.0 NEO [23.43.27642.18]

```

And then GROMACS would show the GPU in the hardware section of the log:

```plaintext
  CPU info:
    Vendor: Intel
    Brand: Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
    Family: 6 Model: 94 Stepping: 3
    Features: aes apic avx avx2 clfsh cmov cx8 cx16 f16c fma htt intel lahf mmx msr nonstop_tsc pcid pclmuldq pdcm pdpe1gb popcnt pse rdrnd rdtscp sse2 sse3 sse4.1 sse4.2 ssse3 tdt x2apic
  Hardware topology: Basic
    Packages, cores, and logical processors:
    [indices refer to OS logical processors]
      Package 0: [0] [1] [2] [3]
    CPU limit set by OS: -1 Recommended max number of threads: 4
  GPU info:
    Number of GPUs detected: 1
    #0: name: Intel(R) HD Graphics 530, vendor: Intel(R) Corporation, device version: OpenCL 3.0 NEO , status: compatible

```

---

<div class="post-metadata">

**Author:** ![UserMIR1](https://avatars.discourse-cdn.com/v4/letter/u/35a633/32.png) [@UserMIR1](https://gromacs.bioexcel.eu/u/UserMIR1)\
**Post date:** [July 26, 2024, 12:11pm UTC](https://gromacs.bioexcel.eu/t/gromacs-sycl-for-intel-gpu-support/9715/5 "2024-07-26T12:11:53Z")

</div>

Thank you very much. I now GROMACS with GPU support.
