Loading p/pytorch/cuda_-_matrix_zeros.py 0 → 100755 +10 −0 Original line number Diff line number Diff line #!/usr/bin/env python # # Create a 10x10 matrix filled with zero via the CUDA device # <https://hpc-community.unige.ch/t/gpu010-cuda-singularity-cuda-runtime-error/306> import torch cuda = torch.device('cuda') a = torch.zeros(10, device=cuda) print(a) p/pytorch/cuda_9.2.148.1_-_matrix_zeros_-_singularity.sbatch 0 → 100644 +28 −0 Original line number Diff line number Diff line #!/bin/sh # # <https://hpc-community.unige.ch/t/gpu010-cuda-singularity-cuda-runtime-error/306> #SBATCH --partition=shared-gpu-EL7 #SBATCH --time=00:15:00 #SBATCH --gres=gpu:1 echo "I: full hostname: $(hostname -f)" module load GCC/5.4.0-2.26 module load Singularity/2.4.5 VERSION_CUDA='9.2.148.1' module load CUDA/${VERSION_CUDA} # if you need to know the allocated CUDA device, you can obtain it here: echo "I: CUDA_VISIBLE_DEVICES: ${CUDA_VISIBLE_DEVICES}" echo "=====" srun singularity \ exec \ --bind $(readlink ${HOME}/scratch) \ --nv \ ${PWD}/pytorch.simg \ python \ ${PWD}/cuda_-_matrix_zeros.py Loading
p/pytorch/cuda_-_matrix_zeros.py 0 → 100755 +10 −0 Original line number Diff line number Diff line #!/usr/bin/env python # # Create a 10x10 matrix filled with zero via the CUDA device # <https://hpc-community.unige.ch/t/gpu010-cuda-singularity-cuda-runtime-error/306> import torch cuda = torch.device('cuda') a = torch.zeros(10, device=cuda) print(a)
p/pytorch/cuda_9.2.148.1_-_matrix_zeros_-_singularity.sbatch 0 → 100644 +28 −0 Original line number Diff line number Diff line #!/bin/sh # # <https://hpc-community.unige.ch/t/gpu010-cuda-singularity-cuda-runtime-error/306> #SBATCH --partition=shared-gpu-EL7 #SBATCH --time=00:15:00 #SBATCH --gres=gpu:1 echo "I: full hostname: $(hostname -f)" module load GCC/5.4.0-2.26 module load Singularity/2.4.5 VERSION_CUDA='9.2.148.1' module load CUDA/${VERSION_CUDA} # if you need to know the allocated CUDA device, you can obtain it here: echo "I: CUDA_VISIBLE_DEVICES: ${CUDA_VISIBLE_DEVICES}" echo "=====" srun singularity \ exec \ --bind $(readlink ${HOME}/scratch) \ --nv \ ${PWD}/pytorch.simg \ python \ ${PWD}/cuda_-_matrix_zeros.py