Skip to content
Snippets Groups Projects
Unverified Commit b9973e98 authored by Luca Capello's avatar Luca Capello
Browse files

p/pytorch/cuda_9.2.148.1_-_matrix_zeros_-_singularity.sbatch: new

parent 2bf9a9f6
No related branches found
No related tags found
No related merge requests found
#!/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)
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment