Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
# spajanje na pristupni poslužitelj
[korisnik@kompjuter:~] $ ssh mkvakic@login-gpu.hpc.srce.hr

# izgradnja pytorch kontejnera
[korisnik@x3000c0s27b0n0:~] $ apptainer build pytorch_1.13.1.sif docker://pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime

# print raznih informacija korištenjem --nv
[korisnik@x3000c0s27b0n0:~] $ apptainer run --nv ./pytorch_1.13.1.sif python -c "import torch; print('Is cuda available?:', torch.cuda.is_available())"
Is cuda available?: True

[korisnik@x3000c0s27b0n0:~] $ apptainer run --nv ./pytorch_1.13.1.sif python -c "import torch; print('Device count:', torch.cuda.device_count())"
Device count: 1

[korisnik@x3000c0s27b0n0:~] $ apptainer run --nv ./pytorch_1.13.1.sif python -c "import torch; print('Current device:', torch.cuda.current_device())"
Current device: 0

[korisnik@x3000c0s27b0n0:~] $ apptainer run --nv ./pytorch_1.13.1.sif python -c "import torch; print('Device name:', torch.cuda.get_device_name(0))"
Device name: NVIDIA A100-PCIE-40GB

...