Project

General

Profile

Bug #2865

OpenCL error with mdrun

Added by zhiyi wu over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

I have tried to compile the GROMACS 2019.1 and 2019.0 on OSX 10.13.6 with Radeon Pro 580 and intel compiler 2019.2.
The compilation is successful but when I tried to run mdrun. It gives
WARNING: While sanity checking device #0, clBuildProgram did not succeed -11: CL_BUILD_PROGRAM_FAILURE

However, 2018.5, 2018.3, 2018.1 works fine in the same system.

Associated revisions

Revision e9d862ea (diff)
Added by Jukka Maatta over 1 year ago

Make OpenCL dummyKernel to require a input parameter

This is a tentative fix for OpenCL error with mdrun on MacOS.
MacOS seems to require that kernel functions have at least one parameter.
Otherwise clBuildProgram fails with error -11.

Here dummyKernel takes an empty pointer in the definition.
We then pass an empty pointer to dummyKernel with clSetKernelArg.

Fixes #2865

Change-Id: Ib7c08eeeb2ec6d8a43bfe703cf1b273819a45a29

Revision 2da186e3 (diff)
Added by Jukka Maatta over 1 year ago

Make OpenCL dummyKernel to require a input parameter

This is a tentative fix for OpenCL error with mdrun on MacOS.
MacOS seems to require that kernel functions have at least one parameter.
Otherwise clBuildProgram fails with error -11.

Here dummyKernel takes an empty pointer in the definition.
We then pass an empty pointer to dummyKernel with clSetKernelArg.

Fixes #2865

Change-Id: Ib7c08eeeb2ec6d8a43bfe703cf1b273819a45a29

History

#1 Updated by Mark Abraham over 1 year ago

AFAIK none of us have tried to use the intel compiler to compile OpenCL for an AMD device. I imagine it should work, but could easily not. Does gcc compile for you?

#2 Updated by zhiyi wu over 1 year ago

I have compiled it with the gcc7 and it doesn't seem to work either.

#3 Updated by Szilárd Páll over 1 year ago

The CPU compiler should have no impact on whether OpenCL compilation works. This failure is from the GPU JIT compiler.

We need to find some someone to pitch in with devices and time to test this; otherwise we may havve to disable OpenCL (or only PME) on Apple.

#4 Updated by Gerrit Code Review Bot over 1 year ago

Gerrit received a related patchset '1' for Issue #2865.
Uploader: Jukka Maatta ()
Change-Id: gromacs~master~Ib7c08eeeb2ec6d8a43bfe703cf1b273819a45a29
Gerrit URL: https://gerrit.gromacs.org/9226

#5 Updated by Jukka Maatta over 1 year ago

Hi,

I tested mdrun with GROMACS 2019.1 on MacOS 10.14.3 and got the same error.

After some more testing:
This seems to be an issue related to the isDeviceSane() function which is called when starting mdrun.
New isDeviceSane check was introduced in GROMACS 2019 which is probably the reason GROMACS 2018 works but 2019 gives errors.

I think the issue was with the creation of dummyKernel to test the OpenCL capabilities.
On MacOS the OpenCL implementation seems to require that kernels need at least one parameter.
I did a simple fix of making dummyKernel to have one parameter as input and then setting it with clSetKernelArg.
After this dummyKernel compiles and everything seems to work again.
I'm a beginner with OpenCL so there probably is a more elegant way to fix this.

#6 Updated by Szilárd Páll over 1 year ago

  • Category set to mdrun
  • Status changed from New to In Progress
  • Assignee set to Szilárd Páll
  • Target version set to 2019.2

Jukka, thanks for figuring this out and uploading the fix. I'll review your change shortly!

#7 Updated by Gerrit Code Review Bot over 1 year ago

Gerrit received a related patchset '1' for Issue #2865.
Uploader: Jukka Maatta ()
Change-Id: gromacs~master~Ic1e1cd216d1d50d7efd73b1a85f136d87e1913b8
Gerrit URL: https://gerrit.gromacs.org/9243

#8 Updated by Gerrit Code Review Bot over 1 year ago

Gerrit received a related patchset '1' for Issue #2865.
Uploader: Mark Abraham ()
Change-Id: gromacs~release-2019~Ib7c08eeeb2ec6d8a43bfe703cf1b273819a45a29
Gerrit URL: https://gerrit.gromacs.org/9245

#9 Updated by Jukka Maatta over 1 year ago

  • Status changed from In Progress to Resolved

#11 Updated by Szilárd Páll over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF