Project

General

Profile

Bug #2821

Compile with OpenCL fails on i686 and armv7hl

Added by Christoph Junghans 3 months ago. Updated about 2 months ago.

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

Description

[ 92%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/ewald/pme-gpu-3dfft-ocl.cpp.o
cd /builddir/build/BUILD/gromacs-2019-rc1/serial/src/gromacs && /usr/bin/c++  -DGMX_DOUBLE=0 -DHAVE_CONFIG_H -DUSE_STD_INTTYPES_H -Dlibgromacs_EXPORTS -I/builddir/build/BUILD/gromacs-2019-rc1/serial/src -I/builddir/build/BUILD/gromacs-2019-rc1/src -I/builddir/build/BUILD/gromacs-2019-rc1/src/external/lmfit -isystem /builddir/build/BUILD/gromacs-2019-rc1/src/external/thread_mpi/include -isystem /builddir/build/BUILD/gromacs-2019-rc1/src/gromacs/../external/clFFT/src/include  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mtune=generic-armv7-a -mabi=aapcs-linux -mfloat-abi=hard -std=c++11   -DNDEBUG -funroll-all-loops -fexcess-precision=fast   -fPIC    -Wno-comment -fopenmp -o CMakeFiles/libgromacs.dir/ewald/pme-gpu-3dfft-ocl.cpp.o -c /builddir/build/BUILD/gromacs-2019-rc1/src/gromacs/ewald/pme-gpu-3dfft-ocl.cpp
make[2]: Leaving directory '/builddir/build/BUILD/gromacs-2019-rc1/serial'
BUILDSTDERR: In file included from /builddir/build/BUILD/gromacs-2019-rc1/src/gromacs/ewald/pme-gpu-3dfft-ocl.cpp:53:
BUILDSTDERR: /builddir/build/BUILD/gromacs-2019-rc1/src/gromacs/ewald/pme-gpu-types.h:77:43: error: static assertion failed: DeviceBuffer is defined as an 8 byte stub for OpenCL C
BUILDSTDERR:  static_assert(sizeof(DeviceBuffer<float>) == 8, "DeviceBuffer is defined as an 8 byte stub for OpenCL C");
BUILDSTDERR:                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
BUILDSTDERR: /builddir/build/BUILD/gromacs-2019-rc1/src/gromacs/ewald/pme-gpu-types.h:78:41: error: static assertion failed: DeviceBuffer is defined as an 8 byte stub for OpenCL C
BUILDSTDERR:  static_assert(sizeof(DeviceBuffer<int>) == 8, "DeviceBuffer is defined as an 8 byte stub for OpenCL C");
BUILDSTDERR:                ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
BUILDSTDERR: make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:8731: src/gromacs/CMakeFiles/libgromacs.dir/ewald/pme-gpu-3dfft-ocl.cpp.o] Error 1
BUILDSTDERR: make[2]: *** Waiting for unfinished jobs....
make[2]: Entering directory '/builddir/build/BUILD/gromacs-2019-rc1/serial'

Build log on i686 from Fedora 30 attached, but I saw it on armv7hl (f30) and i586 (openSUSE) as well.

build.log.txt (1.19 MB) build.log.txt Christoph Junghans, 12/28/2018 06:54 PM

Associated revisions

Revision dabd3b9d (diff)
Added by Szilárd Páll 3 months ago

Fix formatting warning

Some compilers warn if format string does not contain format arguments.

Refs #2821

Change-Id: If71b4eaa61fa5f2400d7f4f706cfe59c1c5d8df8

Revision e9e62337 (diff)
Added by Szilárd Páll about 2 months ago

Require a 64-bit platform for OpenCL

GROMACS requires a 64-bit OpenCL implementation as the PME code assumes
8-byte size cl_mem. Therefore, we require a 64-bit platform,
where pointers and therefore cl_mem will be of the assumed size.

Fixes #2821

Change-Id: I5fa60419a948e2cfdb344e7611b197550f866262

History

#1 Updated by Szilárd Páll 3 months ago

  • Category changed from build system to mdrun
  • Status changed from New to Accepted

pme-gpu-types.h (the HIDE_FROM_OPENCL_COMPILER macro) assumes an 8-byte size for (DeviceBuffer<> and therefore) cl_mem which on some platforms is not true -- here, on 32-bit ARMv7 it's 4 bytes. A quick-and dirty solution is simple, but a more robust solution is desirable and I've no ideas yet.

#2 Updated by Christoph Junghans 3 months ago

Szilárd Páll wrote:

pme-gpu-types.h (the HIDE_FROM_OPENCL_COMPILER macro) assumes an 8-byte size for (DeviceBuffer<> and therefore) cl_mem which on some platforms is not true -- here, on 32-bit ARMv7 it's 4 bytes. A quick-and dirty solution is simple, but a more robust solution is desirable and I've no ideas yet.

Yeah, it worked back in 2018.4, so should we disable GPU support the affected architectures in the fedora package then?
ppc64le and ppc64 were already disabled, but arm7 and i686 would get added.

#3 Updated by Szilárd Páll 3 months ago

Christoph Junghans wrote:

Szilárd Páll wrote:
Yeah, it worked back in 2018.4, so should we disable GPU support the affected architectures in the fedora package then?
ppc64le and ppc64 were already disabled, but arm7 and i686 would get added.

Not sure what the packaging policies are, but in case if 2019 is to be packages as-is for these arch, OpenCL should be disabled on those. Otherwise, if non-upstream small patches are considered during packaging, we can come up with something.

#4 Updated by Christoph Junghans 3 months ago

Szilárd Páll wrote:

Christoph Junghans wrote:

Szilárd Páll wrote:
Yeah, it worked back in 2018.4, so should we disable GPU support the affected architectures in the fedora package then?
ppc64le and ppc64 were already disabled, but arm7 and i686 would get added.

Not sure what the packaging policies are, but in case if 2019 is to be packages as-is for these arch, OpenCL should be disabled on those. Otherwise, if non-upstream small patches are considered during packaging, we can come up with something.

Yes, we can change that in the spec at buildtime, so please tell me what to change for armv7 and i686, patch is preferred but sed it fine, too.

#5 Updated by Christoph Junghans 3 months ago

In 2019, the x86_64 build now also fails with:

make[2]: Leaving directory '/builddir/build/BUILD/gromacs-2019/serial'
BUILDSTDERR: /builddir/build/BUILD/gromacs-2019/src/gromacs/gpu_utils/gpu_utils_ocl.cpp: In function 'int gmx::checkGpu(size_t, const gmx_device_info_t*)':
BUILDSTDERR: /builddir/build/BUILD/gromacs-2019/src/gromacs/gpu_utils/gpu_utils_ocl.cpp:279:107: error: format not a string literal and no format arguments [-Werror=format-security]
BUILDSTDERR:          gmx_warning((formatString("While sanity checking device #%zu, ", deviceId) + errorMessage).c_str());
BUILDSTDERR:                                                                                                            ^
BUILDSTDERR: cc1plus: some warnings being treated as errors
BUILDSTDERR: make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:8900: src/gromacs/CMakeFiles/libgromacs.dir/gpu_utils/gpu_utils_ocl.cpp.o] Error 1

#6 Updated by Szilárd Páll 3 months ago

Christoph Junghans wrote:

In 2019, the x86_64 build now also fails with:
[...]

Fixed here: https://gerrit.gromacs.org/#/c/8912/

#7 Updated by Gerrit Code Review Bot 3 months ago

Gerrit received a related patchset '2' for Issue #2821.
Uploader: Mark Abraham ()
Change-Id: gromacs~release-2019~If71b4eaa61fa5f2400d7f4f706cfe59c1c5d8df8
Gerrit URL: https://gerrit.gromacs.org/8912

#8 Updated by Gerrit Code Review Bot 3 months ago

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

#9 Updated by Gerrit Code Review Bot 3 months ago

Gerrit received a related patchset '1' for Issue #2821.
Uploader: Szilárd Páll ()
Change-Id: gromacs~release-2019~I5fa60419a948e2cfdb344e7611b197550f866262
Gerrit URL: https://gerrit.gromacs.org/8928

#10 Updated by Gerrit Code Review Bot 3 months ago

Gerrit received a related patchset '1' for Issue #2821.
Uploader: Szilárd Páll ()
Change-Id: gromacs~master~I5fa60419a948e2cfdb344e7611b197550f866262
Gerrit URL: https://gerrit.gromacs.org/8929

#11 Updated by Szilárd Páll about 2 months ago

  • Status changed from Accepted to Resolved

#12 Updated by Mark Abraham about 2 months ago

  • Status changed from Resolved to Closed
  • Target version set to 2019.1

Also available in: Atom PDF