Idiomatic multi-gpu usage

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python, pytorch

調査の方向性

Issue にはリポジトリのファイルやテストが記載されていません。まず、示されている PyTorch、CuPy、nvImageCodec の multi-GPU スニペットを再現し、その後、Encoder がデバイスをどのように選択するかを調べてください。完了の条件は、テンソルを意図した GPU 上に保持し、報告された core dump を回避する、文書化された動作する使用方法があることです。

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

説明

question
Describe the question.

I'm trying to utilize this library in multi-gpu torch settings and so far I'm getting no luck with frequent core dumped error, that doesn't tell me much.

my current approach is this (LLM generated):

            dev_idx = _torch.cuda.current_device() if _torch.cuda.is_available() else 0
            with cp.cuda.Device(dev_idx):
                encoder = nvimgcodec.Encoder()
                output_path = frame_dir / f"{to_stem(name)}.tiff"
                gpu_arr = cp.asarray(result.cpu())
                encoder.write(str(output_path), gpu_arr)
                # Release GPU memory retained by CuPy's pool to avoid OOM across concurrent saves
                try:
                    cp.get_default_memory_pool().free_all_blocks()
                except Exception:
                    pass

from nvidia-smi I see that most of the memory is being allocated on GPU 0 and it feels like nvImageEncoder is not explicitly aware of what GPU it is expected to run on. Can you provide example on how to utilize it and keep tensors on GPU?

Check for duplicates
  • I have searched the open bugs/issues and have found no duplicates for this bug report
主要言語
Jupyter Notebook
スター
164
フォーク
26
平均マージ
27分
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

NVIDIA/nvImageCodec のほかの issue

NVIDIA/nvImageCodec の issue をすべて見る

似ている issue

Computer Vision の issue をもっと見る

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

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