Commit e87c5520 authored by rusty1s's avatar rusty1s
Browse files

install cuda

parent d4a9e20e
name: Building
on: [workflow_dispatch]
jobs:
building:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
torch-version: [1.9.0]
cuda-version: ['cu111']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: |
pip install --upgrade pip
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- name: Get pip cache
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-torch==${{ matrix.torch-version }}+${{ matrix.cuda-version }}
- name: Install Cuda ${{ matrix.cuda-version }}
run: |
./.github/workflows/cuda.sh
- name: Install PyTorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }}
run: |
pip install torch==${{ matrix.torch-version}}+${{ matrix.cuda-version }} -f https://download.pytorch.org/whl/torch_stable.html
- name: Install main package
run: |
pip install -e .[test]
- name: Run test-suite
run: |
python setup.py test
ls -lah
ls torch_scatter -lah
#!/bin/bash
# wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
# sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
# wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda-repo-ubuntu2004-11-1-local_11.1.1-455.32.00-1_amd64.deb
# sudo dpkg -i cuda-repo-ubuntu2004-11-1-local_11.1.1-455.32.00-1_amd64.deb
# sudo apt-key add /var/cuda-repo-ubuntu2004-11-1-local/7fa2af80.pub
# sudo apt-get update
# sudo apt-get -y install cuda
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update -qq
sudo apt-get install "cuda-core-11-1" "cuda-nvcc-11-1" "cuda-libraries-dev-11-1"
nvcc --version
# export UBUNTU_VERSION=ubuntu2004
# export CUDA=11-
# INSTALLER="cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb"
# wget -nv "http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER}"
# sudo dpkg -i "${INSTALLER}"
# wget -nv "https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub"
# sudo apt-key add 7fa2af80.pub
# sudo apt update -qq
# sudo apt install "cuda-core-${CUDA_SHORT/./-}" "cuda-nvcc-${CUDA_SHORT/./-}" "cuda-libraries-dev-${CUDA_SHORT/./-}"
# sudo apt clean
# CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
# LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
# PATH=${CUDA_HOME}/bin:${PATH}
# nvcc --version
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment