Skip to content

Commit

Permalink
Add support for CUDA 11 (#3870)
Browse files Browse the repository at this point in the history
Follow-up to #3611

Description of changes:
- Add support for CUDA 11
- Add CUDA 11 CI job
  • Loading branch information
kodiakhq[bot] authored Aug 21, 2020
2 parents 5ba0735 + 4ca9ac8 commit 78a32c3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
35 changes: 24 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: docker.pkg.github.com/espressomd/docker/ubuntu-20.04:8a7d258889d87dcc9c96a200784b30b532d45b33
image: docker.pkg.github.com/espressomd/docker/ubuntu-20.04:e583d4b2eb8eedd10068957f952bd67008475ee5

stages:
- prepare
Expand Down Expand Up @@ -114,7 +114,7 @@ no_rotation:
ubuntu:wo-dependencies:
<<: *global_job_definition
stage: build
image: docker.pkg.github.com/espressomd/docker/ubuntu-wo-dependencies:fc7628d32de0fce605976ba9edebe7eff186e618
image: docker.pkg.github.com/espressomd/docker/ubuntu-wo-dependencies:e583d4b2eb8eedd10068957f952bd67008475ee5
script:
- export myconfig=maxset with_cuda=false make_check_unit_tests=false make_check_python=false
- bash maintainer/CI/build_cmake.sh
Expand Down Expand Up @@ -199,6 +199,24 @@ clang-sanitizer:
- linux
- cuda

cuda11-maxset:
<<: *global_job_definition
stage: build
image: docker.pkg.github.com/espressomd/docker/cuda:e583d4b2eb8eedd10068957f952bd67008475ee5
variables:
CC: 'gcc-9'
CXX: 'g++-9'
script:
- export myconfig=maxset with_cuda=true with_coverage=false test_timeout=900 srcdir=${CI_PROJECT_DIR}
- export with_scafacos=true with_stokesian_dynamics=true
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- cuda
only:
- schedules

cuda10-maxset:
<<: *global_job_definition
stage: build
Expand Down Expand Up @@ -230,11 +248,6 @@ cuda9-maxset:
- export myconfig=maxset with_cuda=true with_coverage=true test_timeout=900 srcdir=${CI_PROJECT_DIR}
- export with_scafacos=true with_stokesian_dynamics=true
- bash maintainer/CI/build_cmake.sh
artifacts:
paths:
- build/
expire_in: 1 week
when: on_success
tags:
- docker
- linux
Expand Down Expand Up @@ -457,7 +470,7 @@ check_cuda_maxset_no_gpu:
<<: *global_job_definition
stage: additional_checks
when: on_success
needs:
needs:
- cuda10-maxset
script:
- export CUDA_VISIBLE_DEVICES=""
Expand All @@ -470,9 +483,9 @@ check_cuda_maxset_no_gpu:

check_with_odd_no_of_processors:
<<: *global_job_definition
stage: additional_checks
stage: additional_checks
when: on_success
needs:
needs:
- cuda10-maxset
script:
- cd ${CI_PROJECT_DIR}/build
Expand Down Expand Up @@ -507,7 +520,7 @@ deploy_sphinx_documentation:
dependencies:
- check_sphinx
script:
- cd ${CI_PROJECT_DIR}/build/doc/sphinx/html &&
- cd ${CI_PROJECT_DIR}/build/doc/sphinx/html &&
rsync -avz --delete -e "ssh -i ${HOME}/.ssh/espresso_rsa" ./ [email protected]:/home/espresso/public_html/html/doc

deploy_doxygen_documentation:
Expand Down
6 changes: 5 additions & 1 deletion cmake/FindCUDACompilerNVCC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ list(APPEND CUDA_NVCC_FLAGS_MINSIZEREL -O2 -Xptxas=-O2 -Xcompiler=-Os -DNDEBUG)
list(APPEND CUDA_NVCC_FLAGS_RELWITHDEBINFO -O2 -g -Xptxas=-O2 -Xcompiler=-O2,-g -DNDEBUG)
list(APPEND CUDA_NVCC_FLAGS_COVERAGE -O3 -g -Xptxas=-O3 -Xcompiler=-Og,-g)
list(APPEND CUDA_NVCC_FLAGS_RELWITHASSERT -O3 -g -Xptxas=-O3 -Xcompiler=-O3,-g)
if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11)
list(APPEND CUDA_NVCC_FLAGS -gencode=arch=compute_30,code=sm_30)
endif()
list(APPEND CUDA_NVCC_FLAGS
-gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_52,code=sm_52
-gencode=arch=compute_52,code=sm_52
-gencode=arch=compute_52,code=compute_52 -std=c++${CMAKE_CUDA_STANDARD}
$<$<BOOL:${WARNINGS_ARE_ERRORS}>:-Xcompiler=-Werror;-Xptxas=-Werror>
$<$<BOOL:${CMAKE_OSX_SYSROOT}>:-Xcompiler=-isysroot;-Xcompiler=${CMAKE_OSX_SYSROOT}>)
Expand All @@ -60,6 +63,7 @@ function(find_gpu_library)
cmake_parse_arguments(LIBRARY "REQUIRED" "NAMES;VARNAME" "" ${ARGN})
list(APPEND LIBRARY_PATHS
${CUDA_TOOLKIT_ROOT_DIR}/lib64 ${CUDA_TOOLKIT_ROOT_DIR}/lib
${CUDA_TOOLKIT_ROOT_DIR}/compat
/usr/local/nvidia/lib /usr/lib/x86_64-linux-gnu)
if(LIBRARY_REQUIRED)
find_library(${LIBRARY_VARNAME} NAMES ${LIBRARY_NAMES} PATHS ${LIBRARY_PATHS} NO_DEFAULT_PATH REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion maintainer/CI/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ make_check=${make_check}
build_type=RelWithAssert
myconfig=maxset
EOF
image="espressomd/docker-ubuntu-20.04:06b6216c7aa3555bcf28c90734dbb84e7285c96f"
image="espressomd/docker-ubuntu-20.04:e583d4b2eb8eedd10068957f952bd67008475ee5"

docker run -u espresso --env-file "${ENV_FILE}" -v "${PWD}:/travis" -it "${image}" /bin/bash -c "cp -r /travis .; cd travis && maintainer/CI/build_cmake.sh" || exit 1

0 comments on commit 78a32c3

Please sign in to comment.