# Successful OpenCL installation returns disabled GPU support

**URL:** <https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253>\
**Category:** User discussions\
**Tags:** gpu, installation-error\
**Created:** [November 15, 2022, 8:50am UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253 "2022-11-15T08:50:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AntonDeni](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@AntonDeni](https://gromacs.bioexcel.eu/u/AntonDeni)\
**Post date:** [November 15, 2022, 8:50am UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253/1 "2022-11-15T08:50:12Z")

</div>

GROMACS version: 2022.3  
GROMACS modification: No  
Hello everyone! I’m having trouble configuring GPU support in Windows Subsystem for Linux (Ubuntu 20.04). trying to set up OpenCL support for AMD. The issue is there are seemingly no issues at this point, the installation is successful, to the point that opencl files are installed by 'make install :

– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/gpu\_utils/device\_utils.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/gpu\_utils/vectype\_ops.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/pbcutil/ishift.h  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/nbnxm/opencl/nbnxm\_ocl\_consts.h  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/nbnxm/opencl/nbnxm\_ocl\_kernel.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/nbnxm/opencl/nbnxm\_ocl\_kernel\_pruneonly.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/nbnxm/opencl/nbnxm\_ocl\_kernel\_utils.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/nbnxm/opencl/nbnxm\_ocl\_kernels.cl  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/nbnxm/opencl/nbnxm\_ocl\_kernels.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/nbnxm/opencl/nbnxm\_ocl\_kernels\_fastgen.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/nbnxm/opencl/nbnxm\_ocl\_kernels\_fastgen\_add\_twincut.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/ewald/pme\_gather.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/ewald/pme\_gpu\_calculate\_splines.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/ewald/pme\_gpu\_types.h  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/ewald/pme\_program.cl  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/ewald/pme\_solve.clh  
– Up-to-date: /usr/local/share/gromacs/opencl/gromacs/ewald/pme\_spread.clh

However when i call gmx --version afterwards, it returns this:  
GROMACS version: 2022.3  
Precision: mixed  
Memory model: 64 bit  
MPI library: thread\_mpi  
OpenMP support: enabled (GMX\_OPENMP\_MAX\_THREADS = 128)  
GPU support: **disabled**  
SIMD instructions: AVX2\_128  
CPU FFT library: fftw-3.3.8-sse2-avx-avx2-avx2\_128  
GPU FFT library: **none**  
RDTSCP usage: enabled  
TNG support: enabled  
Hwloc support: disabled  
Tracing support: disabled  
C compiler: /usr/bin/cc GNU 9.3.0  
C compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -O3 -DNDEBUG  
C++ compiler: /usr/bin/c++ GNU 9.3.0  
C++ compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp

Has anyone dealt with this issue?

---

<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:** [November 15, 2022, 6:46pm UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253/2 "2022-11-15T18:46:16Z")

</div>

Hello!

The output you’re observing is quite unusual. Could you please share the `cmake` invocation you used?

And, just as a sanity check, what’s the output of `./bin/gmx -version` when called from the build directory?

---

<div class="post-metadata">

**Author:** ![AntonDeni](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@AntonDeni](https://gromacs.bioexcel.eu/u/AntonDeni)\
**Post date:** [November 15, 2022, 8:38pm UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253/3 "2022-11-15T20:38:05Z")

</div>

cmake … -DGMX\_BUILD\_OWN\_FFTW=ON -DREGRESSIONTEST\_DOWNLOAD=ON DGMX\_GPU=OpenCL -DGMX\_MPI=on

as for the sanity check,` ./bin/gmx: No such file or directory` when called from the build directory and

```auto
 > :-) GROMACS - gmx, 2022.3 (-:
> 
> Executable: /usr/local/bin/gmx
> Data prefix: /usr/local
> Working dir: /mnt/d/.../gromacs-2022.3/build
> Command line:
> gmx -version
> 
> GROMACS version: 2022.3
> Precision: mixed
> Memory model: 64 bit
> MPI library: thread_mpi
> OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 128)
> GPU support: disabled
> SIMD instructions: AVX2_128
> CPU FFT library: fftw-3.3.8-sse2-avx-avx2-avx2_128
> GPU FFT library: none
> RDTSCP usage: enabled
> TNG support: enabled
> Hwloc support: disabled
> Tracing support: disabled
> C compiler: /usr/bin/cc GNU 9.3.0
> C compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -O3 -DNDEBUG
> C++ compiler: /usr/bin/c++ GNU 9.3.0
> C++ compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp

```

when called from /usr/local/

---

<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:** [November 15, 2022, 9:01pm UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253/4 "2022-11-15T21:01:24Z")

</div>

You’re building GROMACS with library MPI, so the binary is called `gmx_mpi`, not `gmx`. You probably have some other, non-MPI and non-GPU, GROMACS installed

---

<div class="post-metadata">

**Author:** ![AntonDeni](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@AntonDeni](https://gromacs.bioexcel.eu/u/AntonDeni)\
**Post date:** [November 15, 2022, 9:27pm UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253/5 "2022-11-15T21:27:48Z")

</div>

Huh, turns out you’re right. `gmx` and `gmx_mpi` are both sourced and found by wsl, the latter has OpenCL. Tested the mpi version in the tutorial notebook and the temperature equilibration seems to take 16 minutes instead of 16-24 hours now, thank you so much! Guess I’m just going to use gmx\_mpi from now on, unless there is a way to replace old gmx with it

Though apparently mrdun doesn’t detect any devices, which might be a hardware issue, however.

```auto
Executable: /usr/local/bin/gmx_mpi
Data prefix: /usr/local
Working dir: /mnt/d/.../gromacs-2022.3/build
Command line:
  gmx_mpi -version

GROMACS version: 2022.3
Precision: mixed
Memory model: 64 bit
MPI library: MPI
OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 128)
GPU support: OpenCL
SIMD instructions: AVX2_128
CPU FFT library: fftw-3.3.8-sse2-avx-avx2-avx2_128
GPU FFT library: clFFT
RDTSCP usage: enabled
TNG support: enabled
Hwloc support: disabled
Tracing support: disabled
C compiler: /usr/bin/cc GNU 9.3.0
C compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -O3 -DNDEBUG
C++ compiler: /usr/bin/c++ GNU 9.3.0
C++ compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
OpenCL include dir: /usr/include
OpenCL library: /usr/lib/x86_64-linux-gnu/libOpenCL.so
OpenCL version: 2.2

```

---

<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:** [November 15, 2022, 10:08pm UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253/6 "2022-11-15T22:08:44Z")

</div>

> [@AntonDeni](#):
>
> Guess I’m just going to use gmx\_mpi from now on, unless there is a way to replace old gmx with it

You can build GROMACS with threadMPI instead of library MPI by setting `-DGMX_MPI=OFF`. It will compile (and later install) the `gmx` binary. MPI and GPU support are mostly independent.

If you are running on a single machine and not over multiple nodes, the threadMPI build is likely to be more efficient.

There are other CMake settings to directly control the name of the compiled binary, but it’s not a good idea to change them.

> [@AntonDeni](#):
>
> Though apparently mrdun doesn’t detect any devices, which might be a hardware issue, however.

Detected devices are not reported in the `-version` output. You should check the `md.log` file.

---

<div class="post-metadata">

**Author:** ![AntonDeni](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@AntonDeni](https://gromacs.bioexcel.eu/u/AntonDeni)\
**Post date:** [November 16, 2022, 11:38am UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253/7 "2022-11-16T11:38:15Z")

</div>

Pretty much what I thought. I do have a discrete amd graphics card, nbut it might not be supported by wsl.  
As for the thread-mpi compilation, i do have gmx installed, and it seems to function much worse than the mpi package? But i will try reinstalling it.

```auto
Running on 1 node with total 1 cores, 8 processing units (GPU detection failed)
Hardware detected on host (the node of MPI rank 0):
  CPU info:
    Vendor: AMD
    Brand: AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx  
    Family: 23 Model: 17 Stepping: 0
    Features: aes amd apic avx avx2 clfsh cmov cx8 cx16 f16c fma htt lahf misalignsse mmx msr nonstop_tsc pclmuldq pdpe1gb popcnt pse rdrnd rdtscp sha sse2 sse3 sse4a 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

```

---

<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:** [November 16, 2022, 6:40pm UTC](https://gromacs.bioexcel.eu/t/successful-opencl-installation-returns-disabled-gpu-support/5253/8 "2022-11-16T18:40:00Z")

</div>

> [@AntonDeni](#):
>
> `Running on 1 node with total 1 cores, 8 processing units (GPU detection failed)`

Upon some Googling, looks like WSL does not support OpenCL: [https://github.com/microsoft/WSL/issues/6951](https://github.com/microsoft/WSL/issues/6951)

There are announcements from Intel about adding support for their GPUs: [OneAPI/L0, OpenVINO and OpenCL coming to the Windows Subsystem for Linux for Intel GPUs - Windows Command Line](https://devblogs.microsoft.com/commandline/oneapi-l0-openvino-and-opencl-coming-to-the-windows-subsystem-for-linux-for-intel-gpus/), but I could not find anything about the AMD support
