Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
image: "ubuntu-rocm" # Debug device code breaks HIP optimizer

env:
CELER_DISABLE_DEVICE: 1 # REQUIRED for GHA runners
CELER_DISABLE_DEVICE: 1 # REQUIRED for GHA runners without GPUs
CELER_CMAKE_PRESET: >-
${{format('{0}-{1}',
matrix.buildtype,
Expand Down
21 changes: 19 additions & 2 deletions cmake/CeleritasUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Miscellaneous utility functions.

.. command:: celeritas_get_disable_device

Set a variable based on the CELER_DISABLE_DEVICE environment, which
can be used to disable GPU tests::
Set a variable based on the cached CELER_DISABLE_DEVICE env var, which
will disable GPU tests::

celeritas_get_disable_device(<var>)

Expand Down Expand Up @@ -226,6 +226,23 @@ function(celeritas_get_disable_device var)
set(_DISABLE TRUE)
endif()
set(CELERITAS_DISABLE_DEVICE "${_DISABLE}" CACHE INTERNAL "Whether to disable GPU when testing")
else()
# Warn (once per configure) if the environment changed since caching
get_property(_checked GLOBAL PROPERTY CELERITAS_DISABLE_DEVICE_CHECKED)
if(NOT _checked AND (CELERITAS_USE_CUDA OR CELERITAS_USE_HIP))
set_property(GLOBAL PROPERTY CELERITAS_DISABLE_DEVICE_CHECKED TRUE)
set(_env_disable FALSE)
if("$ENV{CELER_DISABLE_DEVICE}")
set(_env_disable TRUE)
endif()
if(CELERITAS_DISABLE_DEVICE AND NOT _env_disable)
message(WARNING
"GPU testing is disabled because CELER_DISABLE_DEVICE was set when "
"first configured, but it is no longer set: reconfigure with "
"'-U CELERITAS_DISABLE_DEVICE' to enable GPU testing"
)
endif()
endif()
endif()
set(${var} "${CELERITAS_DISABLE_DEVICE}" PARENT_SCOPE)
endfunction()
Expand Down
27 changes: 27 additions & 0 deletions scripts/cmake-presets/claude-excl.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,23 @@
}
}
},
{
"name": ".celer-cuda",
"hidden": true,
"cacheVariables": {
"CELERITAS_USE_LArSoft": {
"type": "BOOL",
"value": "OFF"
},
"CMAKE_MODULE_PATH": "/auto/projects/celeritas/view/cuda/share/root/cmake/modules",
"CMAKE_CUDA_ARCHITECTURES": "60"
}
},
{
"name": "release-orange-celer-cuda",
"displayName": "Build with full optimizations for sm_60 against the celer-cuda view (ORANGE, CUDA)",
"inherits": [".celer-cuda", "release-orange-cuda"]
},
{
"name": "reldeb-orange",
"displayName": "Build with optimizations, but enable host debugging (ORANGE)",
Expand Down Expand Up @@ -199,6 +216,11 @@
"jobs": 48,
"nativeToolOptions": ["-k0"]
},
{
"name": "release-orange-celer-cuda",
"configurePreset": "release-orange-celer-cuda",
"inherits": ".base"
},
{
"name": "release-orange-cuda",
"configurePreset": "release-orange-cuda",
Expand Down Expand Up @@ -253,6 +275,11 @@
"jobs": 8
}
},
{
"name": "release-orange-celer-cuda",
"configurePreset": "release-orange-celer-cuda",
"inherits": ".base"
},
{
"name": "release-orange-cuda",
"configurePreset": "release-orange-cuda",
Expand Down
13 changes: 11 additions & 2 deletions scripts/env/claude-excl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
# Settings for apptainer-based Claude on ExCL: the dunesw spack view (CUDA or
# HIP) is selected by the env script that the user sourced beforehand.

export CELER_DISABLE_DEVICE=1
# Disable device code at runtime only if no usable GPU is visible (e.g.
# apptainer launched without --nv/--rocm, or a host without a GPU)
if nvidia-smi -L >/dev/null 2>&1; then
:
elif [ -e /dev/kfd ] && rocm-smi --showid >/dev/null 2>&1; then
:
else
echo "note: no GPU detected; setting CELER_DISABLE_DEVICE=1" >&2
export CELER_DISABLE_DEVICE=1
fi
export CXX=/usr/bin/g++-13
export CC=/usr/bin/gcc-13
export CUDAARCHS="70;80;90;120"
Expand All @@ -20,7 +29,7 @@ fi
export CCACHE_TEMPDIR="${TMPDIR}/ccache"
mkdir -p "${CCACHE_TEMPDIR}"
# Share cache hits regardless of source/build location
export CCACHE_BASEDIR="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
export CCACHE_BASEDIR="$(git rev-parse --show-toplevel 2>/dev/null || $HOME)"
export CCACHE_NOHASHDIR=1

# Require that the user has already sourced one of the view environment
Expand Down
Loading