This repository was archived by the owner on May 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -49,27 +49,23 @@ jobs:
49
49
options : " --gpus=all --shm-size=8g -v /usr/bin/docker:/tmp/docker:ro"
50
50
steps :
51
51
52
- - bash : |
53
- echo "##vso[task.setvariable variable=CONTAINER_ID]$(head -1 /proc/self/cgroup|cut -d/ -f3)"
54
- echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
55
- displayName: 'Set environment variables'
56
-
57
52
- bash : |
58
53
whoami && id
59
54
lspci | egrep 'VGA|3D'
60
55
whereis nvidia
61
56
nvidia-smi
62
- echo $CUDA_VISIBLE_DEVICES
63
- echo $CONTAINER_ID
64
57
python --version
65
58
pip --version
66
59
pip list
67
60
python -c "import torch ; print(torch.cuda.get_arch_list())"
61
+ echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
68
62
displayName: 'Image info & NVIDIA'
69
63
70
64
- script : |
71
- /tmp/docker exec -t -u 0 $CONTAINER_ID \
72
- sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
65
+ container_id=$(head -1 /proc/self/cgroup|cut -d/ -f3)
66
+ /tmp/docker exec -t -u 0 $container_id \
67
+ sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
68
+ echo "##vso[task.setvariable variable=CONTAINER_ID]$container_id"
73
69
displayName: 'Install Sudo in container (thanks Microsoft!)'
74
70
75
71
- bash : |
82
78
displayName: 'Install dependencies'
83
79
84
80
- bash : |
81
+ echo $CUDA_VISIBLE_DEVICES
82
+ echo $CONTAINER_ID
85
83
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu > 0, f'GPU: {mgpu}'"
86
84
displayName: 'Sanity check'
87
85
You can’t perform that action at this time.
0 commit comments