Update McDevol_GPU.yml #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: McDevol | |
on: [push] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Miniconda | |
run: | | |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh | |
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda | |
echo "$HOME/miniconda/bin" >> $GITHUB_PATH | |
source $HOME/miniconda/bin/activate | |
conda init | |
source ~/.bashrc | |
- name: Install NVIDIA CUDA Toolkit | |
run: | | |
sudo apt-get update | |
# sudo apt-get install -y gnupg | |
# wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb | |
# sudo dpkg -i cuda-keyring_1.0-1_all.deb | |
# sudo apt-get update | |
# Install the NVIDIA and CUDA Toolkit 11.0 | |
# sudo apt-get install -y nvidia-driver-510 | |
# sudo apt-get install -y cuda-toolkit-11-0 # Install CUDA 11.0 | |
# echo "/usr/local/cuda/bin" >> $GITHUB_PATH | |
# echo "/usr/local/cuda/lib64" >> $GITHUB_PATH | |
- name: Create Environment | |
env: | |
CONDA_OVERRIDE_CUDA: "11.0" | |
run: | | |
conda env create --file environment.yml --name mcdevol_env | |
- name: Activate Environment | |
run: | | |
source $HOME/miniconda/bin/activate # Ensure the shell is updated with conda initialization | |
conda init | |
conda activate mcdevol_env | |
pip install tensorflow-gpu==2.8.0 | |
- name: Verify CUDA Installation | |
run: | | |
source $HOME/miniconda/bin/activate | |
conda init | |
conda activate mcdevol_env | |
python mcdevol/mcdevol.py -h | |
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))" | |
# nvcc --version | |
# nvidia-smi | |
# - name: Lint with flake8 | |
# run: | | |
# source $HOME/miniconda/bin/activate mcdevol_env | |
# conda install flake8 | |
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
# - name: Test with pytest | |
# run: | | |
# source $HOME/miniconda/bin/activate | |
# conda init | |
# conda activate mcdevol_env | |
# conda install pytest | |
# pytest |