Skip to content

Commit 7265fec

Browse files
committed
CI Linux: do not install the whole CUDA toolkit
Install just the CUDA compiler. Instead of almost 10 GB, install just some 650 MB of dependencies.
1 parent 3ce89c8 commit 7265fec

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/ccpp.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,18 @@ jobs:
6767
${{ matrix.cuda_repo }}/x86_64/cuda-keyring_1.1-1_all.deb
6868
sudo dpkg -i cuda-keyring_1.1-1_all.deb
6969
sudo apt-get update
70-
sudo apt-get -y install ${{ matrix.cuda_pkg }}
70+
cuda_compiler_pkg=$(apt-get -s install ${{ matrix.cuda_pkg }} | grep\
71+
cuda-compiler | head -n 1 | sed 's/.*\(cuda-compiler[-0-9]*\).*/\1/')
72+
sudo apt-get -y install "$cuda_compiler_pkg"
7173
echo CUDACXX=/usr/local/cuda/bin/nvcc >> "$GITHUB_ENV"
72-
- name: Install GCC 8 for CUDA 10.2
74+
- name: Install GCC 8 for CUDA 10.2 + symlink the toolkit
7375
if: matrix.conf == 'legacy'
7476
run: |
77+
sudo ln -s /usr/local/cuda-10.2 /usr/local/cuda
7578
echo 'deb http://archive.ubuntu.com/ubuntu/ focal main universe'\
7679
| sudo tee -a /etc/apt/sources.list
7780
sudo apt update
78-
sudo apt install gcc-8 g++-8
81+
sudo apt install cuda-cudart-dev-10-2 gcc-8 g++-8
7982
sudo ln -sf /usr/bin/gcc-8 /usr/local/cuda/bin/gcc
8083
- name: Build
8184
run: |

0 commit comments

Comments
 (0)