# Gmx mdrun (with OpenCL) no GPU detected

**URL:** <https://gromacs.bioexcel.eu/t/gmx-mdrun-with-opencl-no-gpu-detected/6874>\
**Category:** User discussions\
**Tags:** mdrun, gpu\
**Created:** [July 24, 2023, 10:13am UTC](https://gromacs.bioexcel.eu/t/gmx-mdrun-with-opencl-no-gpu-detected/6874 "2023-07-24T10:13:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VikramMBedi](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@VikramMBedi](https://gromacs.bioexcel.eu/u/VikramMBedi)\
**Post date:** [July 24, 2023, 10:13am UTC](https://gromacs.bioexcel.eu/t/gmx-mdrun-with-opencl-no-gpu-detected/6874/1 "2023-07-24T10:13:10Z")

</div>

GROMACS version:2023.2  
GROMACS modification: Yes/No  
Here post your question

Executable: /usr/local/gromacs-2023.2/bin/gmx  
Data prefix: /usr/local/gromacs-2023.2  
Working dir: /home/1/tutegmx  
Command line:  
gmx --version

GROMACS version: 2023.2  
Precision: mixed  
Memory model: 64 bit  
MPI library: thread\_mpi  
OpenMP support: enabled (GMX\_OPENMP\_MAX\_THREADS = 128)  
GPU support: OpenCL  
NB cluster size: 8  
SIMD instructions: AVX2\_256  
CPU FFT library: Intel MKL version 2023.0.1 Build 20230303  
GPU FFT library: clFFT  
Multi-GPU FFT: none  
RDTSCP usage: enabled  
TNG support: enabled  
Hwloc support: hwloc-2.7.0  
Tracing support: disabled  
C compiler: /opt/intel/oneapi/compiler/2023.1.0/linux/bin/icx IntelLLVM 2023.1.0  
C compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -O3 -DNDEBUG  
C++ compiler: /opt/intel/oneapi/compiler/2023.1.0/linux/bin/icpx IntelLLVM 2023.1.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-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-conditional-uninitialized -Wno-conversion -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-unsafe-buffer-usage -Wno-cast-function-type-strict -fiopenmp -O3 -DNDEBUG  
BLAS library: Intel MKL version 2023.0.1 Build 20230303  
LAPACK library: Intel MKL version 2023.0.1 Build 20230303  
OpenCL include dir: /usr/include  
OpenCL library: /usr/lib/x86\_64-linux-gnu/libOpenCL.so  
OpenCL version: 2.2

when I run mdrun with -nb gpu I am told:  
Cannot run short-ranged nonbonded interactions on a GPU because no GPU is  
detected.

how can I run nb on gpu

thanks

---

<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 24, 2023, 10:22am UTC](https://gromacs.bioexcel.eu/t/gmx-mdrun-with-opencl-no-gpu-detected/6874/2 "2023-07-24T10:22:57Z")

</div>

Hi!

From the error message you posted it’s hard to tell anything. Please attach the full log file (`md.log`), it should contain more details. Do you have a GPU? Which one? What is your OS?

Since you are building with Intel compilers, I assume you have an Intel GPU. In this case:

1. Per [the installation guide](https://manual.gromacs.org/current/install-guide/index.html#opencl-gpu-acceleration), you should add `-DGMX_GPU_NB_CLUSTER_SIZE=4` to your CMake call when building GROMACS. Otherwise, a data layout incompatible with desktop Intel GPUs will be used.

2. However, you might be better off ditching OpenCL and [using SYCL instead](https://manual.gromacs.org/current/install-guide/index.html#sycl-gpu-acceleration-for-intel-gpus). It is more optimized and has better feature support.
