最初からやりたいと思います。
$ vagrant init ubuntu/focal64
$ vagrant up
$ vagrant ssh
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-51-generic x86_64)
$ python3 –version
Python 3.8.5
$ sudo apt update
$ sudo apt install python3-dev python3-pip python3-venv
$ pip3 –version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
### 仮想環境構築
$ python3 -m venv –system-site-packages ./venv
$ source ./venv/bin/activate
$ pip install –upgrade pip
$ pip install –upgrade tensorflow
$ pip install jupyter
$ python -c “import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))”
-> no moduleで上手くいかない
$ free -h
total used free shared buff/cache available
Mem: 981Mi 129Mi 787Mi 0.0Ki 63Mi 745Mi
Swap: 0B 0B 0B
### swap追加
$ sudo fallocate -l 1G /swapfile
$ ls -lh /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ sudo swapon –show
$ free -h
total used free shared buff/cache available
Mem: 981Mi 130Mi 778Mi 0.0Ki 71Mi 740Mi
Swap: 1.0Gi 0B 1.0Gi
$ pip install –upgrade tensorflow
launchpadlib 1.10.13 requires testresources, which is not installed.
$ sudo apt install python3-testresources
$ sudo apt install python3-cairo-dev
$ pip check
No broken requirements found.
$ python -c ‘import tensorflow as tf; print(tf.__version__)’
2021-03-15 09:34:53.575432: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library ‘libcudart.so.11.0’; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-03-15 09:34:53.575530: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2.4.1
1. 仮想環境に作る事
2. swapメモリを追加する事
出来たっぽいな。
さあ、Dockerやるか^^