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

オープン
#4,200 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
49/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

+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

主要言語
C++
スター
241
フォーク
62
平均マージ
1日 1時間
マージ済み PR(30日)
125

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

charmplusplus/charm のほかの issue

charmplusplus/charm の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。