diff --git a/.github/install_gamer_env.sh b/.github/install_gamer_env.sh new file mode 100755 index 0000000000..316433bf21 --- /dev/null +++ b/.github/install_gamer_env.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Install GAMER Environment for GitHub-hosted GitHub Actions runners +# This script installs dependencies needed to compile and run GAMER + +set -e + +echo "Installing GAMER dependencies..." + +# Install OpenMPI, HDF5, and CUDA toolkit +sudo apt-get install -y openmpi-bin libopenmpi-dev libhdf5-dev nvidia-cuda-toolkit + +echo "" +echo "Verifying installations..." +echo "MPI:" +which mpirun +which mpicxx +mpicxx --version + +echo "" +echo "CUDA:" +which nvcc +nvcc --version + +echo "" +echo "HDF5:" +h5cc -show + +echo "" +echo "Configuring GAMER machine settings..." +cd "$(git rev-parse --show-toplevel)/tool/config" +bash set_settings.sh --local --machine=github_action + +echo "" +echo "Verifying configuration..." +cat "$(git rev-parse --show-toplevel)/src/.local_settings" + +echo "" +echo "GAMER environment setup complete!" diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000000..4d1d652e33 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,33 @@ +name: "Copilot Setup Steps" + +# Automatically run the setup steps when they are changed to allow for easy validation, and +# allow manual testing through the repository's "Actions" tab +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + - .github/install_gamer_env.sh + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + - .github/install_gamer_env.sh + +jobs: + # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. + copilot-setup-steps: + runs-on: ubuntu-latest + + # Set the permissions to the lowest permissions possible needed for your steps. + # Copilot will be given its own token for its operations. + permissions: + contents: read + + # You can define any steps you want, and they will run before the agent starts. + # If you do not check out your code, Copilot will do this for you. + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Setup GAMER Environment + run: bash .github/install_gamer_env.sh diff --git a/configs/github_action.config b/configs/github_action.config new file mode 100644 index 0000000000..5f90b38317 --- /dev/null +++ b/configs/github_action.config @@ -0,0 +1,33 @@ +# GitHub-hosted GitHub Actions runners (Ubuntu) +# https://docs.github.com/en/actions/reference/runners/github-hosted-runners + +# 1. Paths +CUDA_PATH /usr +FFTW2_PATH /path/to/fftw2 +FFTW3_PATH /path/to/fftw3 +MPI_PATH /usr +HDF5_PATH /usr/lib/x86_64-linux-gnu/hdf5/serial +GRACKLE_PATH /path/to/grackle +GSL_PATH /path/to/gsl +LIBYT_PATH /path/to/libyt +CUFFTDX_PATH /path/to/cufftdx + +# 2. Compiler type +CXX g++ # Serial compiler +CXX_MPI mpicxx # MPI compiler (The MPI_PATH/bin/ will be combined automatically) + +# 3. Compiler flags +CXXFLAG -g +CXXFLAG -O2 + +OPENMPFLAG -fopenmp + +#LIBFLAG + +NVCCFLAG_COM -O3 -I/usr/include/x86_64-linux-gnu/mpi +#NVCCFLAG_COM -use_fast_math +NVCCFLAG_FLU -Xptxas -dlcm=ca -prec-div=false -ftz=true +NVCCFLAG_POT -Xptxas -dlcm=ca + +# 4. Set the GPU Compute Capability +GPU_COMPUTE_CAPABILITY 750 # NVIDIA Tesla T4