Skip to content

Commit

Permalink
Merge pull request #15 from miguelcarcamov/development
Browse files Browse the repository at this point in the history
FIX: updating checkout github action
  • Loading branch information
miguelcarcamov authored May 7, 2024
2 parents 3f5497a + 29e83a0 commit 2a39358
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 72 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_base_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
push: true # Will only build if this is not here
tags: ${{ env.REGISTRY }}/${{ github.repository }}:base
10 changes: 5 additions & 5 deletions .github/workflows/build_latest_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build-latest-container
on:
pull_request:
branches: [master]
types: [opened, reopened]
types: [opened, reopened, synchronize, closed]
paths:
- '**.cu'
- '**.cuh'
Expand All @@ -22,18 +22,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
file: ./Dockerfile.prod
push: true # Will only build if this is not here
tags: ${{ env.REGISTRY }}/${{ github.repository }}:latest
secrets: |
"BRANCH_NAME=${{ github.head_ref || github.ref_name }}"
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project(gpuvmem LANGUAGES C CXX CUDA)

find_package(CUDAToolkit REQUIRED)
include(CMakePrintHelpers) # In case we need to print any variable

# Set a default build type if not passed
Expand Down Expand Up @@ -33,8 +34,6 @@ option(USE_FAST_MATH
"This option accelerate CUDA math functions decreasing precision")
if(Boost_FOUND)
add_executable(gpuvmem ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cu)
# Search the compute capability of the first GPU and add CUDA specific FLAGS
include(${CMAKE_CURRENT_SOURCE_DIR}/cuda_check.cmake)
file(GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cu)
target_sources(gpuvmem PRIVATE ${SOURCE_FILES})
target_compile_features(gpuvmem PUBLIC cxx_std_11)
Expand Down Expand Up @@ -62,7 +61,7 @@ if(Boost_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/include/classes
${Boost_INCLUDE_DIRS}
${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc)
${CUDAToolkit_LIBRARY_ROOT}/samples/common/inc)

get_target_property(TEMP gpuvmem COMPILE_FLAGS)
if(TEMP STREQUAL "TEMP-NOTFOUND")
Expand All @@ -71,8 +70,9 @@ if(Boost_FOUND)
set(TEMP "${TEMP} ") # A space to cleanly separate from existing content
endif()

set_property(TARGET gpuvmem PROPERTY CUDA_ARCHITECTURES
${CUDA_NVCC_ARCH_FLAGS})
message(STATUS "CUDA Architecture: ${CMAKE_CUDA_ARCHITECTURES}")
message(STATUS "CUDA Version: ${CUDAToolkit_VERSION}")
message(STATUS "CUDA Path: ${CUDAToolkit_LIBRARY_ROOT}")

if(MEMORY_DEBUG)
message(NOTICE "MEMORY DEBUG IS ON")
Expand Down
9 changes: 8 additions & 1 deletion Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ ENV BUILD_DIR "build"
ENV CONFIG "Release"

RUN echo "Installing GPUVMEM"
RUN cmake . -B $BUILD_DIR -DCMAKE_BUILD_TYPE=$CONFIG && \
RUN --mount=type=secret,id=BRANCH_NAME \
export BRANCH_NAME=$(cat /run/secrets/BRANCH_NAME) && \
echo "The source branch of the PR is ${BRANCH_NAME}" && \
echo "Git cloning branch ${BRANCH_NAME}" && \
git clone -b "${BRANCH_NAME}" https://github.com/miguelcarcamov/gpuvmem.git

RUN cd gpuvmem && \
cmake . -B $BUILD_DIR -DCMAKE_BUILD_TYPE=$CONFIG && \
cd $BUILD_DIR && \
cmake --build . --target install --verbose -j `nproc` && \
cd .. && \
Expand Down
34 changes: 0 additions & 34 deletions cuda_check.cmake

This file was deleted.

23 changes: 0 additions & 23 deletions scripts/check_cuda.cu

This file was deleted.

0 comments on commit 2a39358

Please sign in to comment.