Skip to content

Commit

Permalink
Merge pull request #16 from arcaneframework/dev/al-update-script-cuda…
Browse files Browse the repository at this point in the history
…-support

Add cuda support in script and add cuda-120
  • Loading branch information
AlexlHer authored Jan 4, 2023
2 parents 1b1635c + 2cc00ae commit 078362e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
23 changes: 18 additions & 5 deletions .github/scripts/DockerfileGenerator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------

# v1.2
# v1.3

# Valeurs par défaut.
OS=''
Expand Down Expand Up @@ -46,7 +46,7 @@ f_help() {
echo " -h, --help display this help"
echo " -s, --os choose the operating system of the base image"
echo " (ex: -s ubuntu-2204)"
echo " -c, --compiler choose the compiler to compile Arcane (gcc/clang) ('name-version' OR just 'name')"
echo " -c, --compiler choose the compiler to compile Arcane (gcc/clang/cuda) ('name-version' OR just 'name')"
echo " (ex: -c gcc-12) (ex: -c gcc)"
echo " -v, --compiler_version choose the compiler version (optionnal, if just 'name' in --compiler option)"
echo " (ex: -c gcc -v 12)"
Expand All @@ -61,8 +61,11 @@ f_help() {
echo " -o, --dockerfile_out location for the result Dockerfile (same folder by default)"
echo " (ex: -i \"./df/Dockerfile\")"
echo ""
echo "To choose a compiler, you can use the '-c' option OR the '-c' and '-v' options."
echo "You can use only the '-c' option if you want the latest version of the compiler."
echo "Notes:"
echo " - To choose a compiler, you can use the '-c' option OR the '-c' and '-v' options."
echo " - You can use only the '-c' option if you want the latest version of the compiler."
echo " - If you choose 'cuda' in the compiler option, only '.cu' files will be compiled with 'nvcc'."
echo " Other C/C++ files will be compiled with the gcc/g++ compiler available in base image."
echo ""
echo "This script needs a Dockerfile.in file."
}
Expand Down Expand Up @@ -199,6 +202,12 @@ then
C_COMPILER='clang'
CXX_COMPILER='clang++'

elif [ "$COMPILER_NAME" = 'cuda' ]
then
C_COMPILER='gcc'
CXX_COMPILER='g++'
CMAKE_CONFIG+='-D ARCANE_ACCELERATOR_MODE=CUDANVCC -D CMAKE_CUDA_COMPILER=nvcc '

else
echo "Unknown compiler: $COMPILER_NAME"
f_help
Expand Down Expand Up @@ -272,6 +281,10 @@ echo "BASE_IMAGE_DATE= $BASE_IMAGE_DATE"
echo ""
echo "C_COMPILER= $C_COMPILER"
echo "CXX_COMPILER= $CXX_COMPILER"
if [ "$COMPILER_NAME" = 'cuda' ]
then
echo "CUDA_COMPILER= nvcc"
fi
echo "CMAKE_BUILD_TYPE= $CMAKE_BUILD_TYPE"
echo "ARCCORE_BUILD_MODE= $ARCCORE_BUILD_MODE"
echo "ARCANE_BUILD_TYPE= $ARCANE_BUILD_TYPE"
Expand Down Expand Up @@ -306,4 +319,4 @@ then
else
echo ""
echo "Error: Dockerfile not generated."
fi
fi
5 changes: 3 additions & 2 deletions .github/workflows/image_creator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ on:
- 'clang-15'
- 'clang-14'
- 'clang-13'
- 'cuda-116'
- 'cuda-117'
- 'cuda-120'
- 'cuda-118'
- 'cuda-117'
- 'cuda-116'

dependencies:
description: 'Dependencies'
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ date.
If you want to have the same working environment, the same versions of
the tools permanently (to reproduce bugs for example), this tag is good.

Warning : The image tag with `cuda` will (probably) be changed in the future
with the addition of "gcc" or "clang" in it.
Exemple :
- Now : `cuda-120_full_release_latest`
- In the future : `gcc-cuda-120_full_release_latest`


### Base images

Expand Down

0 comments on commit 078362e

Please sign in to comment.