HAPI: +gpushm aborts in hapiInit (ipcHandleOpen, invalid argument) when each process sees only its own GPU

Aperta
#4,200 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
49/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Start in src/arch/cuda/hybridAPI/hapi_impl.cpp around ipcHandleOpen (the report cites lines 1722–1745) and trace how peer device buffers are opened and indexed. Reproduce with one visible GPU per task using --gpus-per-task=1 and +gpushm, then check the manual's GPU messaging section. Done when the behavior matches one of the stated expected outcomes and the manual describes the GPU visibility requirement.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

+gpushm aborts in hapiInit when each process of a node can see only its own GPU, which is the shape Slurm's --gpus-per-task=1 produces.

Observed

NCSA Delta, A100 node, CUDA 13.2, charm reconverse-linux-x86_64 cuda (branch ckdyn-dev7 at 669707835, recharm base 16f27646b; the HAPI code is unchanged there), two processes on one node:

srun --mpi=pmix -n 2 -c 4 --gpus-per-task=1 ./ckdyntest +pe 2 +gpushm
...
HAPI> hapi IPC event pool size - 16 per PE, 16 per device
HAPI> Enabling P2P access between devices
Fatal hapi Error [1] invalid argument at .../src/arch/cuda/hybridAPI/hapi_impl.cpp:1739
------- Processor 0 Exiting: Called CmiAbort ------
Reason: Exit due to hapi error
[0]   #0  hapiErrorDie (libcharm.so)
[0]   #1  hapiInit (libcharm.so)

Both processes abort the same way (job 23677329 on gpua011; the same for a charm4py program). The same binaries with both GPUs visible to both tasks (srun -n 2 --gpus=2 --gpu-bind=none ... +gpushm) start and run; IPC device transfers then work.

Cause

ipcHandleOpen (hapi_impl.cpp, around line 1722-1745) loops over every other process on the physical node and, for each of that process's devices, calls hapiIpcOpenMemHandle on the handle of its device communication buffer. With one GPU per task, that buffer lives on a device this process cannot see (Slurm sets CUDA_VISIBLE_DEVICES per task), and cuIpcOpenMemHandle returns invalid argument. The index device_count * i + j also assumes every process on the node sees the same number of devices.

Expected

Either +gpushm skips peers whose devices are not visible and falls back to the non-IPC path for them, with a message, or hapiInit prints that +gpushm needs all of the node's GPUs visible to every process and aborts with that text instead of invalid argument. The manual's GPU messaging section should state the requirement either way.

Found while validating charm4py 2's device paths on Delta, 2026-11-08. Logs on Delta: /projects/mzu/lkale/software/charm4py-thin/devp-23677329/py_posted_receive_n2shm.log and ckdyn_n2shm.log.

🤖 Generated with Claude Code

Lingua principale
C++
Stelle
241
Fork
62
Merge medio
1g 1h
PR unite (30g)
121

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di charmplusplus/charm

Tutte le issue di charmplusplus/charm

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.