UCT/GDAKI: Try NC uar if WC not supported - v1.24.x #12497
🤖 Starting review — findings will be posted here when done.
<!-- pr-agent-review head_sha: 1a1eecb5a9a077002d6b3770314d741345626350 -->
🤖 Review complete — no issues found.
Approved these changes.
Approved these changes.
Approved these changes.
🤖 CI Triage Agent — UCX-OSS/ucx-test-oss · commit 1a1eecb5
TL;DR: test_init_mt aborted on uct_mem.c:482 Assertion 'mem.memh != UCT_MEM_HANDLE_NULL' failed because the 13 concurrent UCP workers exhausted the container's small /dev/shm, so the posix MD dropped UCT_MD_FLAG_ALLOC and uct_iface_mem_alloc() silently fell back to plain mmap (no memh); fix the thread-count heuristic in contrib/test_jenkins.sh to reserve UCX_POSIX_SHM_MIN_SIZE (and/or make uct_iface_mem_alloc() fail cleanly instead of returning a NULL memh).
<details><summary>Full analysis</summary>
Summary: Parallel stage 82 ("Test", task 2/4 test_init_mt) crashed with a UCX fatal assertion during ucp_worker_create → uct_mm_iface_t_new → uct_iface_mp_chunk_alloc; the shell reported 57362 Aborted ... timeout 5m ./test/apps/test_init_mt (contrib/test_jenkins.sh:1160).
Root cause: Shared-memory exhaustion, not the PR's GDA code. The stage log shows the heuristic max_threads=$(df /dev/shm | awk '/shm/ {printf "%d", $4 / 5000}') yielding max_threads=13, i.e. only ~65 MB available in /dev/shm (default container shm size), and the test then launches 13 threads × ~5 MB each — consuming essentially all of it. uct_posix_md_query() (src/uct/sm/mm/posix/mm_posix.c:144-150) zeroes max_alloc once free shm drops below UCX_POSIX_MM_SHM_MIN_SIZE (default 16 MB), which clears UCT_MD_FLAG_ALLOC. With that flag gone, the "force allocation using MD" branch in uct_iface_mem_alloc() (src/uct/base/uct_mem.c:393-402) is skipped, the mpool chunk is allocated via mmap/heap instead, and because the mm MD advertises UCT_MD_FLAG_NEED_RKEY but not UCT_MD_FLAG_REG (src/uct/sm/mm/base/mm_md.c:73), mem->memh is set to UCT_MEM_HANDLE_NULL (line 433) — tripping the assertion at src/uct/base/uct_mem.c:482. The other three parallel "Test" shards passed because they ran different task subsets / nodes with more free shm.
Implicated commit: unknown — not caused by commit 1a1eecb5 (topic/gda-nc-1-24); the failing heuristic and the fallback path predate it (uct_mem.c last touched by 200aa7e5, Akshay Venkatesh; mm_md.c by 7c972329, Ilia Yastrebov).
File: contrib/test_jenkins.sh:1155 (thread-count heuristic); src/uct/base/uct_mem.c:393-434,482 (silent non-MD fallback)
Suggested fix:
1. Primary (unblocks CI): reserve the posix MD minimum in the heuristic, e.g.
avail_kb=$(df /dev/shm | awk '/shm/ {print $4}'); max_threads=$(( (avail_kb - 16384) / 5000 )) and clamp to >= 1, or explicitly cap with OMP_NUM_THREADS and run the test with a larger pod /dev/shm (e.g. --shm-size=1g / emptyDir medium Memory sizing) — the ucx-test-ubuntu2404-doca29 container appears to use the 64 MB default.
2. Hardening (prevents the fatal abort from recurring in debug builds and silent misbehaviour in release): in uct_iface_mem_alloc(), when need_mem_reg && !support_mem_reg and MD allocation is unavailable, return UCS_ERR_NO_MEMORY (with a ucs_debug/ucs_diag explaining shm exhaustion) instead of returning memory with memh == UCT_MEM_HANDLE_NULL, so uct_iface_open for mm fails gracefully and UCP falls back to another transport.
Related: #12450 (CI: Limit the resources of the jnlp sidecar in Jenkins pods) — same class of container-resource sizing problem; no existing issue found for this exact assertion.
</details>
<!-- triage-agent request_id: a2226438-d298-4ca8-9181-3c453f31b79b -->
<!-- triage-agent gha_run_id: status:SC_kwDOAYNCPs8AAAAN_ABgXg -->
<!-- triage-agent-bot -->
rakhmets
ofirfarjun7
What?
backport #12447