From: Andrey Alekseenko Date: Wed, 3 Nov 2021 09:50:16 +0000 (+0000) Subject: Disable fastmath with OpenCL on Intel devices X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=commitdiff_plain;h=5a6c3b3a5ada87dcc7ede0dc79f7e925376745b5 Disable fastmath with OpenCL on Intel devices Refs #3898 --- diff --git a/docs/user-guide/environment-variables.rst b/docs/user-guide/environment-variables.rst index 026654d369..1698fcedb2 100644 --- a/docs/user-guide/environment-variables.rst +++ b/docs/user-guide/environment-variables.rst @@ -423,6 +423,7 @@ compilation of OpenCL kernels, but they are also used in device selection. ``GMX_OCL_DISABLE_FASTMATH`` Prevents the use of ``-cl-fast-relaxed-math`` compiler option. + Not: fast math is always disabled on Intel devices due to instability. ``GMX_OCL_DUMP_LOG`` If defined, the OpenCL build log is always written to the @@ -442,8 +443,8 @@ compilation of OpenCL kernels, but they are also used in device selection. ``GMX_OCL_NOGENCACHE``). - NVIDIA GPUs: PTX code is saved in the current directory - with the name ``device_name.ptx`` - - AMD GPUs: ``.IL/.ISA`` files will be created for each OpenCL + with the name ``device_name.ptx`` + - AMD GPUs: ``.IL/.ISA`` files will be created for each OpenCL kernel built. For details about where these files are created check AMD documentation for ``-save-temps`` compiler option. diff --git a/src/gromacs/gpu_utils/ocl_compiler.cpp b/src/gromacs/gpu_utils/ocl_compiler.cpp index 5f826e5e0a..64e925b885 100644 --- a/src/gromacs/gpu_utils/ocl_compiler.cpp +++ b/src/gromacs/gpu_utils/ocl_compiler.cpp @@ -169,8 +169,9 @@ static std::string selectCompilerOptions(DeviceVendor deviceVendor) compilerOptions += " -cl-opt-disable"; } - /* Fastmath improves performance on all supported arch */ - if (getenv("GMX_OCL_DISABLE_FASTMATH") == nullptr) + /* Fastmath improves performance on all supported arch, + * but is tends to cause problems on Intel (Issue #3898) */ + if ((deviceVendor != DeviceVendor::Intel) && (getenv("GMX_OCL_DISABLE_FASTMATH") == nullptr)) { compilerOptions += " -cl-fast-relaxed-math";