cuda: add cross-cuda test

This commit is contained in:
Maxandre Ogeret authored and Eli Schwartz committed 2025-05-29 14:30:34 -04:00
1 parent 606ccedddc
commit 7d567901de
6 files changed
+85 -7

No files matched your search

+8 -7
View File
@@ -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
+9
View File
@@ -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'
+8
View File
@@ -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"
}
}
+38
View File
@@ -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
+5
View File
@@ -0,0 +1,5 @@
{
"file": "cuda-cross.txt",
"tests": ["cuda"],
"env": {}
}
+17
View File
@@ -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'