🐳

Rescale の Docker で NVIDIA NGC を使う: NVIDIA Modulus Getting Started を例に

2025/02/16に公開

この記事について

Rescale の計算ノードにインストールされた Docker を使用して, NVIDIA NGC からコンテナを持ってきて実行する方法を示します。実行する題材として, NVIDIA Modulus Getting Started の a quick installation check をやってみます

事前準備: Docker の有効化

Rescale のジョブ設定時のソフトウェア一覧に Docker がありますが、デフォルトではグレーアウトされています

グレーアウトされている Docker のアイコンをクリックして, Software Request を送ります

Rescale の人(営業、技術)に相談したり, Rescale Support にサポートリクエストを出すと、よりスムーズかもしれません

ジョブ設定

以下の設定でジョブを実行します

  • Inputs
    • nvidia_modulus_getting_started.py
  • Software Settings
    • Docker latest (Rescale linux8 GPU)
    • Command
docker run --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 --runtime nvidia -v ${PWD}:/workspace --rm nvcr.io/nvidia/modulus/modulus:24.12 /bin/bash -c "python nvidia_modulus_getting_started.py"
  • Hardware Settings
    • Mallorn 12 cores (NVIDIA A100, 1 GPU)
    • Walltime: 1 hour

nvidia_modulus_getting_started.py は以下の内容です

import torch
from modulus.models.mlp.fully_connected import FullyConnected
model = FullyConnected(in_features=32, out_features=64)
input = torch.randn(128, 32)
output = model(input)
print(output.shape)

このスクリプトは NVIDIA Modulus Getting Started の "A quick installation check can also be done by running the following" を参考にしています

実行結果

process_output.log に torch.Size([128, 64]) が出力されます。したがって正常に a quick installation check ができています

Discussion