Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit 7acaf26

Browse files
committed
ci: gpu split sudo
1 parent 136feef commit 7acaf26

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

.azure/testing-template.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,23 @@ jobs:
4949
options: "--gpus=all --shm-size=8g -v /usr/bin/docker:/tmp/docker:ro"
5050
steps:
5151

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-
5752
- bash: |
5853
whoami && id
5954
lspci | egrep 'VGA|3D'
6055
whereis nvidia
6156
nvidia-smi
62-
echo $CUDA_VISIBLE_DEVICES
63-
echo $CONTAINER_ID
6457
python --version
6558
pip --version
6659
pip list
6760
python -c "import torch ; print(torch.cuda.get_arch_list())"
61+
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
6862
displayName: 'Image info & NVIDIA'
6963
7064
- 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"
7369
displayName: 'Install Sudo in container (thanks Microsoft!)'
7470
7571
- bash: |
@@ -82,6 +78,8 @@ jobs:
8278
displayName: 'Install dependencies'
8379
8480
- bash: |
81+
echo $CUDA_VISIBLE_DEVICES
82+
echo $CONTAINER_ID
8583
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu > 0, f'GPU: {mgpu}'"
8684
displayName: 'Sanity check'
8785

0 commit comments

Comments
 (0)