本題
https://qiita.com/radiol/items/48909d69ba8114edcbf2
こちらのqiitaの記事を参考にしてGPU使用可能のPyTorch環境でJupyter Notebookを使用できる環境を構築しようと考えています.
しかし私の環境は
MacOS version10.15.7のため少し環境が違うため,記事通りに実行をしても,うまく実行ができない状況にあります.
こちらの記事を多少変更して,Dockerfileを以下のように変更してdockerをbuildしてimageを作成できました(変更点はnodejsのversion指定したことです).
Dockerfile
1FROM pytorch/pytorch:latest 2 3# Install required libraries 4RUN conda config --add channels pytorch \ 5 && conda config --append channels conda-forge \ 6 && conda update --all --yes --quiet \ 7 && conda install --yes --quiet \ 8 ipywidgets \ 9 jupyterlab \ 10 matplotlib \ 11 nodejs \ 12 opencv \ 13 pandas \ 14 scikit-learn \ 15 seaborn \ 16 sympy \ 17 && conda clean --all -f -y 18 19RUN conda install "nodejs>=12.0" 20 21# Install jupyter extensions 22RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension \ 23 && jupyter labextension install @jupyter-widgets/jupyterlab-manager 24 25COPY jupyter_notebook_config.py /root/.jupyter/
そして,現在位置(~/new_env)において以下のコマンドを実行したところ次のようなエラーがおきました.
terminal
1$ docker run -d --rm --gpus all -v ~/udemy/pytorch_5days/new_env:/workspace -p 8888:8888 --name pchan pytorch-lab jupyter lab 2# ~~~英数字の羅列~~~ # 3docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
そのためgpu環境を構築できないようなエラーが出ました.
このエラーに関して調べたところ
https://qiita.com/tomp/items/50081b99df7963462488
こちらの記事が参考になると思ったのですが,
環境がMacであるため sudo apt-get等の動作ができないためこのエラーを打破できない状況にあります.
どうすれば,このエラーを回避して環境を構築できるか教えていただけると幸いです.
別件
また,別の質問ではありますが,これが回避できない場合はどのようにしてGPUのPyTorchの環境を構築すればよろしいでしょうか(個人的にGoogle Colabolatoryはファイルの参照の方法が多少面倒のため,Dockerを使用したいと考えております).
宜しくお願いいたします.
あなたの回答
tips
プレビュー