Skip to content

Commit 4c0495d

Browse files
cuda: add cross-cuda test
1 parent 2c2309b commit 4c0495d

File tree

6 files changed

+79
-7
lines changed

6 files changed

+79
-7
lines changed

.github/workflows/images.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
cfg:
40-
- { name: Arch Linux, id: arch }
41-
- { name: CUDA (on Arch), id: cuda }
42-
- { name: Fedora, id: fedora }
43-
- { name: Gentoo, id: gentoo }
44-
- { name: OpenSUSE, id: opensuse }
45-
- { name: Ubuntu Bionic, id: bionic }
46-
- { name: Ubuntu Rolling, id: ubuntu-rolling }
40+
- { name: Arch Linux, id: arch }
41+
- { name: CUDA (on Arch), id: cuda }
42+
- { name: CUDA Cross (on Ubuntu Jammy), id: cuda-cross }
43+
- { name: Fedora, id: fedora }
44+
- { name: Gentoo, id: gentoo }
45+
- { name: OpenSUSE, id: opensuse }
46+
- { name: Ubuntu Bionic, id: bionic }
47+
- { name: Ubuntu Rolling, id: ubuntu-rolling }
4748
steps:
4849
# Need v3 because of bionic
4950
- uses: actions/checkout@v3

.github/workflows/nonnative.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ jobs:
5151
name: "Ubuntu nonnative"
5252
fail_ci_if_error: false
5353
verbose: true
54+
55+
cross-cuda:
56+
runs-on: ubuntu-latest
57+
container: mesonbuild/cuda-cross:latest
58+
env:
59+
MESON_CI_JOBNAME: cuda-cross-${{ github.job }}
60+
steps:
61+
- name: Run tests
62+
run: bash -c 'source /ci/env_vars.sh; cd $GITHUB_WORKSPACE; ./tools/run_with_cov.py ./run_tests.py $CI_ARGS --cross cuda-cross.json --cross-only'

ci/ciimage/cuda-cross/image.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"base_image": "ubuntu:22.04",
3+
"args": ["--only", "cuda"],
4+
"env": {
5+
"CI": "1",
6+
"MESON_CI_JOBNAME": "linux-cuda-cross"
7+
}
8+
}

ci/ciimage/cuda-cross/install.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
source /ci/common.sh
6+
7+
export DEBIAN_FRONTEND=noninteractive
8+
export LANG='C.UTF-8'
9+
10+
apt-get -y update
11+
apt-get -y upgrade
12+
apt-get -y install wget
13+
14+
# Cuda repo + keyring.
15+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
16+
apt-get -y install ./cuda-keyring_1.1-1_all.deb
17+
18+
# Cuda cross repo.
19+
echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/cross-linux-aarch64/ /" \
20+
> /etc/apt/sources.list.d/cuda-ubuntu2204-cross-linux-aarch64.list
21+
apt-get -y update
22+
23+
pkgs=(
24+
clang cmake crossbuild-essential-arm64
25+
crossbuild-essential-arm64 cuda-cross-aarch64
26+
cuda-nvcc-12-9 git ninja-build pkg-config python3-pip
27+
)
28+
29+
apt-get -y install "${pkgs[@]}"
30+
31+
install_minimal_python_packages
32+
33+
# cleanup
34+
apt-get -y clean
35+
apt-get -y autoclean
36+
rm cuda-keyring_1.1-1_all.deb

cross/cuda-cross.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"file": "cuda-cross.txt",
3+
"tests": ["cuda"],
4+
"env": {}
5+
}

cross/cuda-cross.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[binaries]
2+
c = ['/usr/bin/aarch64-linux-gnu-gcc']
3+
cpp = ['/usr/bin/aarch64-linux-gnu-g++']
4+
cuda = ['/usr/local/cuda/bin/nvcc', '-ccbin', '/usr/bin/aarch64-linux-gnu-gcc']
5+
ar = '/usr/bin/aarch64-linux-gnu-ar'
6+
strip = '/usr/bin/aarch64-linux-gnu-strip'
7+
ld = '/usr/bin/aarch64-linux-gnu-ld'
8+
9+
[host_machine]
10+
system = 'linux'
11+
cpu_family = 'aarch64'
12+
cpu = 'aarch64'
13+
endian = 'little'

0 commit comments

Comments
 (0)