Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuda related container updates #1157

Merged
merged 4 commits into from
Jun 16, 2023
Merged
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
19 changes: 15 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ variables:
ubuntu_20_04_tag: alpinedav/ascent-ci:ubuntu-20.04-devel-tpls_2023-05-05-shaf57286
ubuntu_22_04_tag: alpinedav/ascent-ci:ubuntu-22.04-devel-tpls_2023-05-05-shaf57286
ubuntu_18_04_cuda_11_4_0_tag: alpinedav/ascent-ci:ubuntu-18.04-cuda-11.4.0-devel-tpls_2023-05-05-shaf57286
ubuntu_20_04_rocm_5_1_3_tag: alpinedav/ascent-ci:ubuntu-20.04-rocm-5.1.3-devel-tpls_2023-05-05-shaf57286


ubuntu_20_04_rocm_5_1_3_tag: alpinedav/ascent-ci:ubuntu-20.04-rocm-5.1.3-devel-tpls_2023-06-15-sha370c0c
ubuntu_20_04_cuda_12_1_1_tag: alpinedav/ascent-ci:ubuntu-20.04-cuda-12.1.1-devel-tpls_2023-06-13-sha647407
# only build merge target pr to develop
trigger: none
pr:
Expand Down Expand Up @@ -438,6 +438,17 @@ stages:
COMPILER_FC: gfortran
strategy:
matrix:
ubuntu_20.04_static_cuda_12.1.1:
containerImage: ${{ variables.ubuntu_20_04_cuda_12_1_1_tag }}
BUILD_SHARED_LIBS: OFF
CMAKE_BUILD_TYPE: Release
ENABLE_DRAY: ON
ENABLE_MFEM: ON
BLT_CXX_STD: c++14
# static linking unit tests eats up alot of disk space,
# so skip building tests in CI to keep us away from clif
ENABLE_TESTS: OFF

ubuntu_18.04_static_cuda_11.4.0:
containerImage: ${{ variables.ubuntu_18_04_cuda_11_4_0_tag }}
BUILD_SHARED_LIBS: OFF
Expand Down Expand Up @@ -597,7 +608,7 @@ stages:
${CMAKE_EXE} --version
cat /ascent-config.cmake
# configure
${CMAKE_EXE} -S src -B build -C /ascent-config.cmake -DCMAKE_INSTALL_PREFIX=install
${CMAKE_EXE} -S src -B build -C /ascent-config.cmake -DENABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX=install
displayName: 'Configure with CMake'

- script: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Ascent.

FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
FROM nvidia/cuda:12.1.1-devel-ubuntu20.04

# add sudo to base cuda devel env
# so we can install additional packages as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# other details. No copyright assignment is required to contribute to Ascent.
set -ev

export TAG_NAME=alpinedav/ascent-ci:ubuntu-22.04-cuda-11.8.0-devel
export TAG_NAME=alpinedav/ascent-ci:ubuntu-20.04-cuda-12.1.1-devel

# exec docker build to create image
echo "docker build -t ${TAG_NAME} ."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Ascent.

FROM alpinedav/ascent-ci:ubuntu-22.04-cuda-11.8.0-devel
FROM alpinedav/ascent-ci:ubuntu-20.04-cuda-12.1.1-devel

# obtain a copy of ascent source from host env,
# which we use to call uberenv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# other details. No copyright assignment is required to contribute to Ascent.
set -ev

export TAG_BASE=alpinedav/ascent-ci:ubuntu-22.04-cuda-11.8.0-devel-tpls
export TAG_BASE=alpinedav/ascent-ci:ubuntu-20.04-cuda-12.1.1-devel-tpls

date

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export PATH=$PATH:/${cmake_install_dir}/bin/

# build rocm tpls with helper script
chmod +x ascent/scripts/build_ascent/build_ascent.sh
env build_ascent=false enable_hip=true ascent/scripts/build_ascent/build_ascent.sh
# enable tests is of b/c one of the vtk-m tests fails to link
env enable_tests=OFF build_ascent=false enable_hip=ON ascent/scripts/build_ascent/build_ascent.sh

############################
# TODO: get spack working
Expand Down
19 changes: 14 additions & 5 deletions src/libs/dray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@

# adjust cmake options into proper defs for generate dray_config.h

if(ENABLE_OPENMP)
set(DRAY_OPENMP_ENABLED TRUE)
message(STATUS "DRay OpenMP Support Enabled")
endif()

if(ENABLE_CUDA)
set(DRAY_CUDA_ENABLED TRUE)
message(STATUS "DRay CUDA Support Enabled")
endif()

if(ENABLE_HIP)
set(DRAY_HIP_ENABLED TRUE)
message(STATUS "DRay HIP Support Enabled")
endif()

if(MFEM_FOUND)
set(DRAY_MFEM_ENABLED TRUE)
Expand All @@ -20,11 +34,6 @@ if(DRAY_USE_DOUBLE_PRECISION)
message(STATUS "DRay using double precision")
endif()

if(ENABLE_OPENMP)
set(DRAY_OPENMP_ENABLED TRUE)
message(STATUS "DRay OpenMP Support Enabled")
endif()

if(DRAY_ENABLE_STATS)
set(DRAY_STATS TRUE)
message(STATUS "DRay Stats enabled")
Expand Down
14 changes: 4 additions & 10 deletions src/libs/dray/dray_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,18 @@
#define DRAY_CONFIG_H

// config time defines
#cmakedefine DRAY_MFEM_ENABLED
#cmakedefine DRAY_OPENMP_ENABLED
#cmakedefine DRAY_CUDA_ENABLED
#cmakedefine DRAY_HIP_ENABLED
#cmakedefine DRAY_MFEM_ENABLED
#cmakedefine DRAY_ENABLE_LOGGING
#cmakedefine DRAY_USE_DOUBLE_PRECISION
#cmakedefine DRAY_STATS

#include <RAJA/RAJA.hpp>

#if defined(__CUDACC__) && !defined(DEBUG_CPU_ONLY)

#define DRAY_CUDA_ENABLED
#define DRAY_EXEC RAJA_INLINE RAJA_HOST_DEVICE
#define DRAY_EXEC_ONLY RAJA_INLINE RAJA_DEVICE
#define DRAY_LAMBDA RAJA_DEVICE

#elif defined(__HIP_PLATFORM_HCC__) && !defined(DEBUG_CPU_ONLY)
#if defined(DRAY_CUDA_ENABLED) ||defined(DRAY_HIP_ENABLED)

#define DRAY_HIP_ENABLED
#define DRAY_EXEC RAJA_INLINE RAJA_HOST_DEVICE
#define DRAY_EXEC_ONLY RAJA_INLINE RAJA_DEVICE
#define DRAY_LAMBDA RAJA_DEVICE
Expand Down