Skip to content

Commit 8fa364f

Browse files
wip
1 parent 44d3523 commit 8fa364f

5 files changed

Lines changed: 203 additions & 81 deletions

File tree

.github/workflows/gpu.yml

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ jobs:
1919
BUILDCACHE_COMPRESS: true
2020
BUILDCACHE_DIRECT_MODE: true
2121
BUILDCACHE_ACCURACY: SLOPPY
22-
BUILDCACHE_MAX_CACHE_SIZE: 5368709120
22+
BUILDCACHE_MAX_CACHE_SIZE: 16106127360
2323
CUDACXX: /usr/local/cuda/bin/nvcc
2424
CLICOLOR_FORCE: 1
2525
LD_LIBRARY_PATH: /usr/local/cuda/lib64
26+
# protect_shadow_gap=0 is required for CUDA + ASan's combo.
27+
ASAN_OPTIONS: alloc_dealloc_mismatch=0:protect_shadow_gap=0
28+
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1:print_stacktrace=1
29+
COMPUTE_SANITIZER: /usr/local/cuda/bin/compute-sanitizer --tool memcheck --error-exitcode 1
2630
steps:
2731
- uses: actions/checkout@v4
2832

@@ -31,6 +35,7 @@ jobs:
3135

3236
- name: Configure
3337
run: |
38+
cmake --preset cuda-sanitizer --compile-no-warning-as-error
3439
cmake --preset cuda
3540
cmake --preset cpu
3641
@@ -39,11 +44,20 @@ jobs:
3944
./build/cuda/buildcache/bin/buildcache -z
4045
cmake --build --preset cuda --target motis nigiri-test
4146
cmake --build --preset cpu --target motis
47+
# Sanitizer compiles need several GB per translation unit, so the
48+
# default (one job per core) can exhaust RAM on the runner.
49+
cmake --build --preset cuda-sanitizer --target motis -j 8
4250
./build/cuda/buildcache/bin/buildcache -s
4351
4452
- name: nigiri-test
4553
run: ./build/cuda/deps/nigiri/nigiri-test
4654

55+
- name: nigiri-test (compute-sanitizer memcheck)
56+
run: |
57+
/usr/local/cuda/bin/compute-sanitizer --tool memcheck \
58+
--error-exitcode 1 --launch-timeout 120 \
59+
./build/cuda/deps/nigiri/nigiri-test
60+
4761
- name: Save deps
4862
if: always()
4963
run: mv deps ~
@@ -65,51 +79,41 @@ jobs:
6579
6680
- name: Validate Germany
6781
run: |
68-
python3 tools/validate.py ./build/cpu/motis ./build/cuda/motis \
69-
--data "$HOME/ci-data/ger/data" \
70-
--name germany \
71-
--date 2026-07-10 \
72-
--intermodal \
73-
--routed-footpaths \
74-
--tts \
75-
--exclude-transit-modes HIGHSPEED_RAIL \
76-
--n 20
82+
# Germany queries are cheap, so the sanitized runs keep the full n.
83+
GER="--data $HOME/ci-data/ger/data --name germany --date 2026-07-10
84+
--intermodal --routed-footpaths --tts
85+
--exclude-transit-modes HIGHSPEED_RAIL --n 25"
86+
python3 tools/validate.py ./build/cpu/motis ./build/cuda/motis $GER
87+
python3 tools/validate.py ./build/cuda-san/motis $GER
88+
python3 tools/validate.py ./build/cuda/motis $GER \
89+
--launcher "$COMPUTE_SANITIZER"
7790
7891
- name: Validate Europe
7992
run: |
80-
python3 tools/validate.py ./build/cpu/motis ./build/cuda/motis \
81-
--data "$HOME/ci-data/eu/data" \
82-
--name europe \
83-
--date 2026-07-24 \
84-
--rt-dir "$HOME/ci-data/eu" \
85-
--intermodal \
86-
--routed-footpaths \
87-
--flex \
88-
--bike \
89-
--tts \
90-
--exclude-transit-modes COACH \
91-
--n 20 \
92-
--n_threads 8
93+
EU="--data $HOME/ci-data/eu/data --name europe --date 2026-07-24
94+
--rt-dir $HOME/ci-data/eu --intermodal --routed-footpaths --flex
95+
--bike --tts --exclude-transit-modes COACH --n_threads 8"
96+
python3 tools/validate.py ./build/cpu/motis ./build/cuda/motis $EU --n 20
97+
python3 tools/validate.py ./build/cuda-san/motis $EU --n 10
98+
python3 tools/validate.py ./build/cuda/motis $EU --n 10 \
99+
--launcher "$COMPUTE_SANITIZER"
93100
94101
- name: Validate Europe RENTAL
95102
run: |
96-
python3 tools/validate.py ./build/cpu/motis ./build/cuda/motis \
97-
--data "$HOME/ci-data/eu/data-rental" \
98-
--gbfs-dir "$HOME/ci-data/eu" \
99-
--rt-dir "$HOME/ci-data/eu" \
100-
--name europe-rental \
101-
--date 2026-07-24 \
102-
--intermodal \
103-
--rental \
104-
--bounds '{"type":"Polygon","coordinates":[[[1.4461,48.1200],[3.5599,48.1200],[3.5599,49.2415],[1.4461,49.2415],[1.4461,48.1200]]]}' \
105-
--n 20 \
106-
--n_threads 8
103+
BOUNDS='{"type":"Polygon","coordinates":[[[1.4461,48.1200],[3.5599,48.1200],[3.5599,49.2415],[1.4461,49.2415],[1.4461,48.1200]]]}'
104+
RENT="--data $HOME/ci-data/eu/data-rental --gbfs-dir $HOME/ci-data/eu
105+
--rt-dir $HOME/ci-data/eu --name europe-rental --date 2026-07-24
106+
--rental --n_threads 8"
107+
python3 tools/validate.py ./build/cpu/motis ./build/cuda/motis $RENT --bounds "$BOUNDS" --n 20
108+
python3 tools/validate.py ./build/cuda-san/motis $RENT --bounds "$BOUNDS" --n 10
109+
python3 tools/validate.py ./build/cuda/motis $RENT --bounds "$BOUNDS" --n 10 \
110+
--launcher "$COMPUTE_SANITIZER"
107111
108112
- name: Validate Switzerland ODM
109113
run: |
110-
python3 tools/validate.py ./build/cpu/motis ./build/cuda/motis \
111-
--data "$HOME/ci-data/ch/data" \
112-
--name switzerland \
113-
--date 2026-07-06 \
114-
--flex \
115-
--n 1000
114+
CH="--data $HOME/ci-data/ch/data --name switzerland --date 2026-07-06
115+
--flex"
116+
python3 tools/validate.py ./build/cpu/motis ./build/cuda/motis $CH --n 250
117+
python3 tools/validate.py ./build/cuda-san/motis $CH --n 100
118+
python3 tools/validate.py ./build/cuda/motis $CH --n 100 \
119+
--launcher "$COMPUTE_SANITIZER"

.pkg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[nigiri]
22
url=git@github.com:motis-project/nigiri.git
33
branch=master
4-
commit=a6220fe111cb78e20f3db08ef0a75842e5f0dffb
4+
commit=8aff4fe133fe5f5cc02629bf7ebc33bf6fe6a41c
55
[cista]
66
url=git@github.com:felixguendling/cista.git
77
branch=master

.pkg.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1774533628642490707
1+
8574267008437315260
22
cista 427f0a873be43f1de94289bd53d5678e07cd243f
33
zlib-ng d68e1d908e789c31c1f2fafe4bd8e09cb91e21c5
44
boost b050b3988ba25ea7757462d26a38d225bfe20f75
@@ -36,7 +36,7 @@ pugixml bb45e30c5bf21b3599eb5b4b7fa20547043c3e24
3636
sol2 40c7cbc7c5cfed1e8c7f1bbe6fcbe23d7a67fc75
3737
unordered_dense 2c7230ae7f9c30849a5b089fb4a5d11896b45dcf
3838
wyhash 1e012b57fc2227a9e583a57e2eacb3da99816d99
39-
nigiri a6220fe111cb78e20f3db08ef0a75842e5f0dffb
39+
nigiri 8aff4fe133fe5f5cc02629bf7ebc33bf6fe6a41c
4040
conf f9bf4bd83bf55a2170725707e526cbacc45dcc66
4141
expat 636c9861e8e7c119f3626d1e6c260603ab624516
4242
libosmium aec81a466451d5c6913df503e543806129df02d1

CMakePresets.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,31 @@
142142
"CMAKE_CXX_COMPILER": "g++-15"
143143
}
144144
},
145+
{
146+
"name": "cuda-sanitizer",
147+
"displayName": "Linux CUDA Host C++-only ASan + UBSan",
148+
"generator": "Ninja",
149+
"binaryDir": "${sourceDir}/build/cuda-san",
150+
"cacheVariables": {
151+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
152+
"NIGIRI_CUDA": "ON",
153+
"CMAKE_C_COMPILER": "gcc-15",
154+
"CMAKE_CXX_COMPILER": "g++-15",
155+
"CMAKE_CUDA_COMPILER": "/usr/local/cuda/bin/nvcc",
156+
"CMAKE_CUDA_HOST_COMPILER": "g++-15",
157+
"CTX_ASAN": "ON",
158+
"CMAKE_C_FLAGS": "-fsanitize=address -fno-omit-frame-pointer",
159+
"CMAKE_CXX_FLAGS": "-fsanitize=address,undefined -fno-omit-frame-pointer",
160+
"CMAKE_CUDA_FLAGS": "-Xcompiler=-fsanitize=address -Xcompiler=-fsanitize=undefined -Xcompiler=-fno-omit-frame-pointer",
161+
"CMAKE_EXE_LINKER_FLAGS": "-fsanitize=address,undefined",
162+
"CMAKE_C_FLAGS_RELWITHDEBINFO": "-O1 -g",
163+
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-O1 -g",
164+
"CMAKE_CUDA_FLAGS_RELWITHDEBINFO": "-O2 -g"
165+
},
166+
"environment": {
167+
"ASAN_OPTIONS": "protect_shadow_gap=0"
168+
}
169+
},
145170
{
146171
"name": "clang-tidy",
147172
"displayName": "Clang Tidy",
@@ -186,6 +211,13 @@
186211
"name": "cpu",
187212
"configurePreset": "cpu"
188213
},
214+
{
215+
"name": "cuda-sanitizer",
216+
"configurePreset": "cuda-sanitizer",
217+
"environment": {
218+
"ASAN_OPTIONS": "detect_leaks=0:protect_shadow_gap=0"
219+
}
220+
},
189221
{
190222
"name": "clang-tidy",
191223
"configurePreset": "clang-tidy"

0 commit comments

Comments
 (0)