mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-11-27 17:43:18 +00:00
Merge branch 'saqibkh-add-gpu-sim-ci' into next
This commit is contained in:
3 files changed
+129
-2
No files matched your search
@@ -0,0 +1,123 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# SPDX-FileCopyrightText: 2026 Saqib Khan <saqibkhan@utexas.edu>
|
||||
name: CUDA on simulated H100
|
||||
|
||||
# The hosted runners have no GPU, so the other workflows never build with
|
||||
# ENABLE_CUDA=ON. This builds gnss-sdr and run_tests with the CUDA blocks and
|
||||
# runs the CUDA unit tests on a simulated NVIDIA H100
|
||||
# (https://github.com/pantheongpu/pantheonsim). A simulator cannot reproduce
|
||||
# hardware-specific behavior or timing, so it complements real-GPU testing and
|
||||
# does not replace it.
|
||||
|
||||
# A cache saved by a pull request run is only visible to that pull request. The
|
||||
# runs on pushes to next save the simulator build and the ccache where every
|
||||
# pull request targeting next can restore them.
|
||||
# Pull requests run this job only if they touch the CUDA code. A change
|
||||
# elsewhere that breaks the CUDA build is caught by the run on next.
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- next
|
||||
paths:
|
||||
- "src/**"
|
||||
- "tests/**"
|
||||
- "cmake/**"
|
||||
- "CMakeLists.txt"
|
||||
- ".github/workflows/gpu-sim.yml"
|
||||
pull_request:
|
||||
paths:
|
||||
# CUDA sources, the GPU tracking block and their tests
|
||||
- "**/*cuda*"
|
||||
- "**/*gpu*"
|
||||
- "**/*.cu"
|
||||
# Code with CUDA-specific branches
|
||||
- "src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.*"
|
||||
- "src/algorithms/acquisition/libs/acq_conf.*"
|
||||
- "src/algorithms/signal_source/gnuradio_blocks/evk1029_source.*"
|
||||
# Where the CUDA sources are added to the build
|
||||
- "src/algorithms/acquisition/libs/CMakeLists.txt"
|
||||
- "src/algorithms/tracking/libs/CMakeLists.txt"
|
||||
- "src/algorithms/signal_source/libs/CMakeLists.txt"
|
||||
- ".github/workflows/gpu-sim.yml"
|
||||
|
||||
# Runs on next are left to finish, so that they save their caches
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
cuda-sim:
|
||||
name: CUDA 13.0 on simulated H100
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
# library-path false: the build links the toolkit's cuFFT as usual, and
|
||||
# the tests run under `vgpu run`, which supplies the simulator's libraries
|
||||
- name: Set up the simulated H100 and CUDA toolkit
|
||||
uses: pantheongpu/setup-pantheonsim@v0.1.10
|
||||
with:
|
||||
gpu: nvidia/h100
|
||||
cuda-toolkit: "13.0"
|
||||
library-path: "false"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends ninja-build ccache \
|
||||
libunwind-dev libboost-dev libboost-date-time-dev libboost-system-dev \
|
||||
libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \
|
||||
libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr \
|
||||
libpugixml-dev libpcap-dev libblas-dev liblapack-dev libarmadillo-dev \
|
||||
libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev libmatio-dev \
|
||||
googletest protobuf-compiler libprotobuf-dev python3-mako liborc-0.4-dev
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.cache/ccache
|
||||
key: ccache-gpu-sim-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-gpu-sim-
|
||||
|
||||
# The simulator runs PTX (90-virtual) and needs the shared CUDA runtime.
|
||||
# The setup action exports a CMAKE_TOOLCHAIN_FILE that only selects that
|
||||
# runtime, which is done here explicitly: it is unset because GNSS-SDR
|
||||
# takes a toolchain file as a sign of cross-compilation.
|
||||
# ENABLE_EVK1029 adds cuda_ddc_engine.cu to the build.
|
||||
- name: Configure
|
||||
run: |
|
||||
unset CMAKE_TOOLCHAIN_FILE
|
||||
cmake -S . -B build -GNinja \
|
||||
-DENABLE_CUDA=ON \
|
||||
-DENABLE_EVK1029=ON \
|
||||
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-13.0/bin/nvcc \
|
||||
-DCUDAToolkit_ROOT=/usr/local/cuda-13.0 \
|
||||
-DCMAKE_CUDA_ARCHITECTURES=90-virtual \
|
||||
-DCMAKE_CUDA_RUNTIME_LIBRARY=Shared \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
|
||||
|
||||
- name: Build gnss-sdr and run_tests
|
||||
run: |
|
||||
unset CMAKE_TOOLCHAIN_FILE
|
||||
ccache -z
|
||||
cmake --build build -j3 --target gnss-sdr run_tests
|
||||
ccache -s
|
||||
|
||||
- name: CUDA acquisition engine tests
|
||||
run: vgpu run --gpu nvidia/h100 ./install/run_tests --gtest_filter='CudaPcpsEngineTest.*'
|
||||
|
||||
- name: CUDA PCPS acquisition block tests
|
||||
run: vgpu run --gpu nvidia/h100 ./install/run_tests --gtest_filter='GpsL1CaPcpsAcquisitionCudaTest.*'
|
||||
|
||||
- name: CUDA multicorrelator test
|
||||
run: vgpu run --gpu nvidia/h100 ./install/run_tests --gtest_filter='GpuMulticorrelatorTest.*'
|
||||
@@ -185,6 +185,8 @@ All notable changes to GNSS-SDR will be documented in this file.
|
||||
with the current Khronos OpenCL C++ bindings (`CL/opencl.hpp`, from
|
||||
OpenCL-CLHPP v2026.05.29). A system-wide `CL/opencl.hpp` is used if found, and
|
||||
the bundled copy otherwise.
|
||||
- Added a CI job that builds the CUDA processing blocks and runs their unit
|
||||
tests on a simulated GPU. Contributed by @saqibkh.
|
||||
|
||||
### Improvements in Reliability:
|
||||
|
||||
|
||||
@@ -255,12 +255,14 @@ void run_parity_case(const PcpsScenario& sc, uint32_t dwells)
|
||||
const GridPeak pc = find_peak(cpu.magnitude(), bins, E);
|
||||
const GridPeak pg = find_peak(gpu_grid, bins, E);
|
||||
EXPECT_EQ(pc.bin, pg.bin) << "Doppler bin of the peak differs";
|
||||
EXPECT_EQ(pc.index, pg.index) << "Code phase of the peak differs";
|
||||
// The local code is tiled sampled_ms times, so the grid repeats every code
|
||||
// period and the peak is a sampled_ms-way tie that only rounding breaks.
|
||||
const uint32_t samples_per_code = static_cast<uint32_t>(sc.fs_in / 1000);
|
||||
EXPECT_EQ(pc.index % samples_per_code, pg.index % samples_per_code) << "Code phase of the peak differs";
|
||||
|
||||
// And the peak must sit where the synthetic signal was put
|
||||
const int32_t expected_bin = (sc.doppler_max + static_cast<int32_t>(std::lround(sc.doppler_hz))) / sc.doppler_step;
|
||||
EXPECT_NEAR(static_cast<double>(pg.bin), static_cast<double>(expected_bin), 1.0);
|
||||
const uint32_t samples_per_code = static_cast<uint32_t>(sc.fs_in / 1000);
|
||||
EXPECT_EQ(pg.index % samples_per_code, sc.delay_samples % samples_per_code);
|
||||
|
||||
std::cout << " fft_size=" << N << " bins=" << bins << " dwells=" << dwells
|
||||
|
||||
Reference in new issue
Block a user