Skip to content

Commit dd84180

Browse files
authored
Merge pull request #489 from STEllAR-GROUP/flag_for_intel_gpu_workaround
Flag for intel gpu workaround
2 parents 3182a1e + 4c81898 commit dd84180

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

.jenkins/lsu/Jenkinsfile-Node-Level

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pipeline {
6666
' +kokkos simd_extension=SCALAR simd_library=KOKKOS %gcc@11^[email protected] max_cpu_count=128 malloc=jemalloc %gcc@11 ^kokkos %gcc@11 ^hpx-kokkos %gcc@11 ^cppuddle %gcc@11 ^silo~mpi ;with-CC-with-kokkos-with-scalar;gcc/11;medusa --exclusive;--fresh',\
6767
' +kokkos simd_extension=AVX512 simd_library=KOKKOS %gcc@11^[email protected] max_cpu_count=128 malloc=jemalloc %gcc@11 ^kokkos %gcc@11 ^hpx-kokkos %gcc@11 ^cppuddle %gcc@11 ^silo~mpi ;with-CC-with-kokkos-with-avx512;gcc/11;medusa --exclusive;--fresh',\
6868
' +kokkos +kokkos_hpx_kernels multipole_host_tasks=16 monopole_host_tasks=4 hydro_host_tasks=4 simd_extension=AVX512 simd_library=KOKKOS %gcc@11^[email protected] max_cpu_count=128 malloc=jemalloc %gcc@11 ^kokkos %gcc@11 ^hpx-kokkos %gcc@11 ^cppuddle %gcc@11 ^silo~mpi ;with-CC-with-kokkos-with-avx512-with-hpx-kokkos-kernels;gcc/11;medusa --exclusive;--fresh',\
69-
' -cuda -rocm +sycl %gcc@11 ^[email protected] use_unsupported_sycl_arch=70 ^[email protected] sycl_target_arch=70;with-CC-with-kokkos-with-sycl;gcc/11 cuda/12;cuda-V100 -w diablo --gpus=1 --exclusive;--fresh'
69+
' -cuda -rocm +sycl %gcc@11 ^[email protected] use_unsupported_sycl_arch=70 ^[email protected] sycl_target_arch=70;with-CC-with-kokkos-with-sycl;gcc/11 cuda/12;cuda-V100 -w diablo --gpus=1 -c 10 --exclusive;--fresh'
7070
}
7171
}
7272
stages {

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ option(OCTOTIGER_WITH_QUADMATH "Enable sections using GCC Quad-Precision Math Li
5151
option(OCTOTIGER_WITH_Vc "" ON)
5252
# Re-enables Vc datatypes in the octotiger parts - use with caution
5353
option(OCTOTIGER_WITH_LEGACY_Vc "" OFF)
54+
# Use workaround to make Intel GPUs work as intended
55+
# May cause rare segfault during cleanup when using the KOKKOS SYCL backend on NVIDIA hardware
56+
option(OCTOTIGER_WITH_INTEL_GPU_WORKAROUND "This activates a workaround that enables SYCL builds to run on Intel GPUs with Octotiger (but cause problems for SYCL builds with CUDA" OFF)
5457

5558
# TODO Can these safely be removed? They should be deprecated
5659
option(OCTOTIGER_WITH_AVX "" OFF)
@@ -742,6 +745,13 @@ elseif(OCTOTIGER_WITH_Vc AND USE_AVX AND OCTOTIGER_WITH_AVX)
742745
set(OCTOTIGER_WITH_AVX512 OFF CACHE BOOL "" FORCE)
743746
endif()
744747

748+
# Intel GPU workarounds...
749+
if(OCTOTIGER_WITH_INTEL_GPU_WORKAROUND)
750+
message(WARNING " Compiling with SYCL Intel GPU workaround (might cause cleanup segfaults when using the SYCL CUDA backend)")
751+
target_compile_definitions(octolib PUBLIC OCTOTIGER_HAVE_INTEL_GPU_WORKAROUND)
752+
target_compile_definitions(hydrolib PUBLIC OCTOTIGER_HAVE_INTEL_GPU_WORKAROUND)
753+
endif()
754+
745755
# Handle CUDA
746756
if(OCTOTIGER_WITH_CUDA)
747757
message(INFO " CUDA support is turned on!")

src/monopole_interactions/monopole_kernel_interface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030
#include "octotiger/options.hpp"
3131

3232
#if defined(OCTOTIGER_HAVE_KOKKOS) && defined(KOKKOS_ENABLE_SYCL)
33+
#if defined(OCTOTIGER_HAVE_INTEL_GPU_WORKAROUND)
3334
#include "octotiger/sycl_initialization_guard.hpp"
3435
static const char module_identifier_monopoles[] = "gravity_solver_monopoles";
3536
/// Dummy variable to ensure the touch_sycl_device_by_running_a_dummy_kernel is being run
3637
const int init_sycl_device_monopoles =
3738
octotiger::sycl_util::touch_sycl_device_by_running_a_dummy_kernel<module_identifier_monopoles>();
39+
#else
40+
#pragma message "SYCL builds without OCTOTIGER_WITH_INTEL_GPU_WORKAROUND=ON may break on Intel GPUs"
41+
#endif
3842
#endif
3943

4044
#if defined(OCTOTIGER_HAVE_KOKKOS)

src/multipole_interactions/multipole_kernel_interface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@
3030
#include "octotiger/options.hpp"
3131

3232
#if defined(OCTOTIGER_HAVE_KOKKOS) && defined(KOKKOS_ENABLE_SYCL)
33+
#if defined(OCTOTIGER_HAVE_INTEL_GPU_WORKAROUND)
3334
#include "octotiger/sycl_initialization_guard.hpp"
3435
static const char module_identifier_multipoles[] = "gravity_solver_multipoles";
3536
/// Dummy variable to ensure the touch_sycl_device_by_running_a_dummy_kernel is being run
3637
const int init_sycl_device_multipoles =
3738
octotiger::sycl_util::touch_sycl_device_by_running_a_dummy_kernel<
3839
module_identifier_multipoles>();
40+
#else
41+
#pragma message "SYCL builds without OCTOTIGER_WITH_INTEL_GPU_WORKAROUND=ON may break on Intel GPUs"
42+
#endif
3943
#endif
4044

4145
#ifdef OCTOTIGER_HAVE_KOKKOS

src/unitiger/hydro_impl/hydro_kernel_interface.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@
1515
#ifdef OCTOTIGER_HAVE_KOKKOS
1616
#include "octotiger/unitiger/hydro_impl/hydro_kokkos_kernel.hpp"
1717
#endif
18-
#if defined(OCTOTIGER_HAVE_KOKKOS) && defined(KOKKOS_ENABLE_SYCL)
18+
19+
#if defined(OCTOTIGER_HAVE_KOKKOS) && defined(KOKKOS_ENABLE_SYCL)
20+
#if defined(OCTOTIGER_HAVE_INTEL_GPU_WORKAROUND)
1921
#include "octotiger/sycl_initialization_guard.hpp"
2022
static const char module_identifier_hydro[] = "hydro_solver";
2123
/// Dummy variable to ensure the touch_sycl_device_by_running_a_dummy_kernel is being run
2224
const int init_sycl_device_hydro =
2325
octotiger::sycl_util::touch_sycl_device_by_running_a_dummy_kernel<module_identifier_hydro>();
26+
#else
27+
#pragma message "SYCL builds without OCTOTIGER_WITH_INTEL_GPU_WORKAROUND=ON may break on Intel GPUs"
2428
#endif
29+
#endif
30+
2531
#if defined(OCTOTIGER_HAVE_KOKKOS)
2632
hpx::once_flag init_hydro_kokkos_pool_flag;
2733
#if defined(KOKKOS_ENABLE_CUDA)

0 commit comments

Comments
 (0)