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


Nadogradnja sandbox kontejnera sa korištenjem  --nv opcije moguća je nakon modifikacije sandbox direktorija izvan kontejnera. 

Code Block
titleKorištenje "sandbox" slike kontejnera sa --nv opcijom
# izgradnja test.sandbox sandbox slike kontejnera
[korisnik@x3000c0s27b0n0:~] $ apptainer build --sandbox --fix-perms test.sandbox test.def

# modifikacija slike kontejnera
[korisnik@x3000c0s27b0n0:~] $ touch test.sanbox/usr/bin/nvidia-smi
[korisnik@x3000c0s27b0n0:~] $ touch test.sanbox/usr/bin/nvidia-debugdump
[korisnik@x3000c0s27b0n0:~] $ touch test.sanbox/usr/bin/nvidia-persistenced
[korisnik@x3000c0s27b0n0:~] $ touch test.sanbox/usr/bin/nvidia-cuda-mps-control
[korisnik@x3000c0s27b0n0:~] $ touch test.sanbox/usr/bin/nvidia-cuda-mps-server
[korisnik@x3000c0s27b0n0:~] $ mkdir -p test.sandbox/var/run/nvidia-persistenced/
[korisnik@x3000c0s27b0n0:~] $ touch test.sanbox/var/run/nvidia-persistenced/socket

# pokretanje "sandbox" kontainera sa --nv opcijom
[korisnik@x3000c0s27b0n0:~] $ apptainer shell --nv --writable --fakeroot test.sandbox


NVIDIA NGC kontejneri

Tip
NVIDIA driveri na pristupnom poslužitelju su nadograđeni i usklađeni sa radnim poslužiteljima u siječnju 2024. godine!
Izgradnja valjanog kontejnera sa NGC repozitorija moguća je na pristupnom poslužitelju bez --bind opcije ili dodatnih naredbi i konfiguracije.

...