diff options
| -rw-r--r-- | .github/workflows/images.yml | 15 | ||||
| -rw-r--r-- | .github/workflows/nonnative.yml | 9 | ||||
| -rw-r--r-- | ci/ciimage/cuda-cross/image.json | 8 | ||||
| -rwxr-xr-x | ci/ciimage/cuda-cross/install.sh | 38 | ||||
| -rw-r--r-- | cross/cuda-cross.json | 5 | ||||
| -rw-r--r-- | cross/cuda-cross.txt | 17 |
6 files changed, 85 insertions, 7 deletions
diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index d20f7e5ce..369c91e2d 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -37,13 +37,14 @@ jobs: fail-fast: false matrix: cfg: - - { name: Arch Linux, id: arch } - - { name: CUDA (on Arch), id: cuda } - - { name: Fedora, id: fedora } - - { name: Gentoo, id: gentoo } - - { name: OpenSUSE, id: opensuse } - - { name: Ubuntu Bionic, id: bionic } - - { name: Ubuntu Rolling, id: ubuntu-rolling } + - { name: Arch Linux, id: arch } + - { name: CUDA (on Arch), id: cuda } + - { name: CUDA Cross (on Ubuntu Jammy), id: cuda-cross } + - { name: Fedora, id: fedora } + - { name: Gentoo, id: gentoo } + - { name: OpenSUSE, id: opensuse } + - { name: Ubuntu Bionic, id: bionic } + - { name: Ubuntu Rolling, id: ubuntu-rolling } steps: # Need v3 because of bionic - uses: actions/checkout@v3 diff --git a/.github/workflows/nonnative.yml b/.github/workflows/nonnative.yml index 2712d1032..e6fce04b1 100644 --- a/.github/workflows/nonnative.yml +++ b/.github/workflows/nonnative.yml @@ -51,3 +51,12 @@ jobs: name: "Ubuntu nonnative" fail_ci_if_error: false verbose: true + + cross-cuda: + runs-on: ubuntu-latest + container: mesonbuild/cuda-cross:latest + env: + MESON_CI_JOBNAME: cuda-cross-${{ github.job }} + steps: + - name: Run tests + run: bash -c 'source /ci/env_vars.sh; cd $GITHUB_WORKSPACE; ./run_tests.py $CI_ARGS --cross cuda-cross.json --cross-only' diff --git a/ci/ciimage/cuda-cross/image.json b/ci/ciimage/cuda-cross/image.json new file mode 100644 index 000000000..062322ec8 --- /dev/null +++ b/ci/ciimage/cuda-cross/image.json @@ -0,0 +1,8 @@ +{ + "base_image": "ubuntu:22.04", + "args": ["--only", "cuda", "--cross", "cuda-cross.json"], + "env": { + "CI": "1", + "MESON_CI_JOBNAME": "linux-cuda-cross" + } +} diff --git a/ci/ciimage/cuda-cross/install.sh b/ci/ciimage/cuda-cross/install.sh new file mode 100755 index 000000000..6b5fe7f2b --- /dev/null +++ b/ci/ciimage/cuda-cross/install.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +set -e + +source /ci/common.sh + +export DEBIAN_FRONTEND=noninteractive +export LANG='C.UTF-8' + +apt-get -y update +apt-get -y upgrade +apt-get -y install wget + +# Cuda repo + keyring. +wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb +apt-get -y install ./cuda-keyring_1.1-1_all.deb + +# Cuda cross repo. +echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/cross-linux-aarch64/ /" \ + > /etc/apt/sources.list.d/cuda-ubuntu2204-cross-linux-aarch64.list +apt-get -y update + +pkgs=( + clang cmake crossbuild-essential-arm64 cuda-cross-aarch64 + cuda-nvcc-12-9 git libglib2.0-dev ninja-build pkg-config python3-pip +) + +apt-get -y install "${pkgs[@]}" + +install_minimal_python_packages + +# Tests need nvcc in PATH in order to run cuda tests. +echo "export PATH=\$PATH:/usr/local/cuda/bin" >> /ci/env_vars.sh + +# cleanup +apt-get -y clean +apt-get -y autoclean +rm cuda-keyring_1.1-1_all.deb diff --git a/cross/cuda-cross.json b/cross/cuda-cross.json new file mode 100644 index 000000000..f2d008688 --- /dev/null +++ b/cross/cuda-cross.json @@ -0,0 +1,5 @@ +{ + "file": "cuda-cross.txt", + "tests": ["cuda"], + "env": {} +} diff --git a/cross/cuda-cross.txt b/cross/cuda-cross.txt new file mode 100644 index 000000000..7e8146300 --- /dev/null +++ b/cross/cuda-cross.txt @@ -0,0 +1,17 @@ +[binaries] +c = ['/usr/bin/aarch64-linux-gnu-gcc'] +cpp = ['/usr/bin/aarch64-linux-gnu-g++'] +cuda = ['/usr/local/cuda/bin/nvcc'] +ar = '/usr/bin/aarch64-linux-gnu-ar' +strip = '/usr/bin/aarch64-linux-gnu-strip' +ld = '/usr/bin/aarch64-linux-gnu-ld' + +[host_machine] +system = 'linux' +cpu_family = 'aarch64' +cpu = 'aarch64' +endian = 'little' + +[built-in options] +cuda_link_args = ['-lstdc++'] +cuda_ccbindir = '/usr/bin/aarch64-linux-gnu-gcc' |
