これを実行。データは下記。
https://github.com/notfolder/svhn
splitしたので、catで結合して使う。
cat svhn_image.tar.gz.1 svhn_image.tar.gz.2 > svhn_image.tar.gz
pip freeze結果
asn1crypto==0.24.0
certifi==2018.1.18
chardet==3.0.4
cryptography==2.1.4
dataclasses==0.7
future==0.18.2
idna==2.6
imageio==2.1.2
keyring==10.6.0
keyrings.alt==3.0
numpy==1.14.6
Pillow==5.3.0
protobuf==3.13.0
pycrypto==2.6.1
pygobject==3.26.1
pyxdg==0.25
requests==2.18.4
SecretStorage==2.3.1
six==1.11.0
ssh-import-id==5.7
tensorboardX==1.4
torch==1.7.0
torchsummary==1.5.1
torchvision==0.8.1
tqdm==4.26.0
typing-extensions==3.7.4.3
urllib3==1.22
Dockerfileはこれ。vscode-server.tgzは無くてよし
FROM nvidia/cuda:10.0-base-ubuntu18.04
# sshサーバをインストールします
RUN apt-get update && apt-get install -y openssh-server
# これが無いとsshdが起動しないっぽい
RUN mkdir /var/run/sshd
# sshのrootでのアクセスを許可します。ただし、パスワードでのアクセスは無効
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config
# ホスト側にある公開鍵をイメージ側に登録します
COPY id_rsa.pub /root/.ssh/authorized_keys
# add sudo user
RUN groupadd -g 1000 notfolder && \
useradd -g notfolder -G sudo -m -s /bin/bash notfolder
RUN echo 'Defaults visiblepw' >> /etc/sudoers
RUN echo 'notfolder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
#COPY id_rsa.pub /home/notfolder/.ssh/authorized_keys
RUN mkdir -p /home/notfolder/.ssh
COPY id_rsa.pub /home/notfolder/.ssh/authorized_keys
RUN chown 1000:1000 -R /home/notfolder
RUN chmod 700 /home/notfolder/.ssh
RUN apt-get update && apt-get install -y python3 && \
apt-get install -y python3-pip && \
update-alternatives --install /usr/bin/python python /usr/bin/python3 0 && \
update-alternatives --set python /usr/bin/python3 && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 0 && \
update-alternatives --set pip /usr/bin/pip3 && \
pip install --upgrade pip
COPY vscode-server.tgz /tmp/
RUN tar -zxf /tmp/vscode-server.tgz -C /home/notfolder/
COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
nvidia-smiは下記。
$ nvidia-smi
Fri Nov 13 22:46:44 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.80.02 Driver Version: 450.80.02 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce RTX 2070 Off | 00000000:04:00.0 Off | N/A |
| 29% 35C P0 20W / 175W | 0MiB / 7982MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+