tutorials
Ubuntu 18.04
Docker
PairLab
nvidia-smi
sudo apt-get install gcc -y
sudo apt-get install make
sudo service gdm3 stop
sudo reboot
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
ubuntu-drivers devices
## <VERSION_STRING>版本請依照所需
sudo apt-get install nvidia-driver-<VERSION_STRING>
sudo service gdm3 start
sudo reboot
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
apt-cache madison docker-ce
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
將14行改成如下(目標資料夾為/docker_disk)
sudo vim /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --data-root /docker_disk -s overlay2 -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
儲存後輸入
sudo systemctl daemon-reload
sudo service docker restart
sudo docker run --gpus all -it --name (NAME) --shm-size 1G --ipc=host -p (B):22 -p (A):8888 -p (C):6006 (image)
## NAME、A、B、C為自取(將NAME取代成想要的名子,A取代為想要的port(不是改8888))
## A為開啟 jupyter notebook 的port
## B為遠端 ssh 的 port,C為開啟 tensorboard 的 port
## EX:sudo docker run --gpus all -it --name test --shm-size 1G --ipc=host -p 50000:22 -p 50050:8888 -p 50051:6006 titi861203/cuda11.0-cudnn8-tf2.4-torch1.7.1
sudo docker start (name)
## tensorflow
python3 -c "import tensorflow as tf;print('Can your tensorflow use GPU?');print(tf.test.is_gpu_available());"
## pytorch
python3 -c "import torch as t;print('Can your pytorch use GPU?');print(t.cuda.is_available());"
需先申請docker hub帳號
mkdir docker_file && cd docker_file
vim Dockerfile
指令介紹:
FROM:使用到的 Docker Image 名稱
MAINTAINER: 用來說明,撰寫和維護這個 Dockerfile 的人是誰,也可以給 E-mail的資訊
RUN: RUN 指令後面放 Linux 指令,用來執行安裝和設定這個 Image 需要的東西
ADD: 把 Local 的檔案複製到 Image 裡,如果是 tar.gz 檔複製進去 Image 時會順便自動解壓縮。
ENV: 用來設定環境變數
CMD: 在指行 docker run 的指令時會直接呼叫開啟 Tomcat Service
PyTorch2.0.0 CUDA11.7.1 Ubuntu22.04
FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
MAINTAINER Titi Wei <a2699560@gmail.com>
RUN apt-get update
RUN apt-get upgrade -y
RUN echo 'root:12345678' | chpasswd
RUN apt-get install -y openssh-server python3 python3-pip vim wget git libcupti-dev iputils-ping curl screen
RUN echo "PermitRootLogin yes">>/etc/ssh/sshd_config
RUN /etc/init.d/ssh restart
RUN service ssh start
RUN echo "service ssh start">>~/.bashrc
RUN pip3 install --upgrade pip
RUN pip3 install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1
RUN pip install jupyter jupyterlab
RUN jupyter notebook --generate-config
RUN echo "c.NotebookApp.password = u'sha1:1170ee6efd7d:7868110829c753e16815394c7507dc7450dd1655'" >> /root/.jupyter/jupyter_notebook_config.py
RUN echo "c.NotebookApp.terminado_settings = { 'shell_command': ['bash'] }">>/root/.jupyter/jupyter_notebook_config.py
RUN echo "jupyter lab --allow-root --ip=0.0.0.0" >> /root/.jupyter.sh
RUN chmod +x /root/.jupyter.sh
FROM nvidia/cuda:11.0-cudnn8-devel-ubuntu18.04
MAINTAINER Titi Wei <a2699560@gmail.com>
RUN apt-get update
RUN apt-get upgrade -y
RUN apt update
RUN apt upgrade
RUN echo 'root:12345678' | chpasswd
RUN apt-get install -y openssh-server python3 python3-pip vim wget git libcupti-dev iputils-ping curl screen
RUN echo "PermitRootLogin yes">>/etc/ssh/sshd_config
RUN /etc/init.d/ssh restart
RUN pip3 install --upgrade pip
RUN pip install tensorflow-gpu==2.4.0
RUN pip install torch==1.7.1 torchvision==0.8.2
RUN pip install jupyter jupyterlab
RUN jupyter notebook --generate-config
RUN pip install matplotlib pillow lxml pandas Cython opencv-python openpyxl
RUN pip install scikit-image --upgrade
RUN apt-get install dbus-x11
RUN echo "X11Forwarding yes">> /etc/ssh/sshd_config
RUN echo "X11UseLocalhost no">> /etc/ssh/sshd_config
RUN grep "^X11UseLocalhost" /etc/ssh/sshd_config || echo "X11UseLocalhost no" >> /etc/ssh/sshd_config
RUN echo "service ssh start">>~/.bashrc
RUN echo "alias python='/usr/bin/python3'">>~/.bashrc
RUN echo "c.NotebookApp.terminado_settings = { 'shell_command': ['bash'] }">>/root/.jupyter/jupyter_notebook_config.py
RUN service ssh start
RUN wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda_11.1.0_455.23.05_linux.run
RUN chmod +x cuda_11.1.0_455.23.05_linux.run
RUN sh cuda_11.1.0_455.23.05_linux.run --tar mxvf
Pytorch1.4 version by yssu
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
MAINTAINER YuSheng Su <yushengsu.ai09@nycu.edu.tw>
RUN apt-get update
RUN apt-get upgrade -y
RUN apt update
RUN apt upgrade
RUN echo 'root:12345678' | chpasswd
RUN apt-get install -y openssh-server python3 python3-pip vim wget git libcupti-dev iputils-ping curl screen
RUN echo "PermitRootLogin yes">>/etc/ssh/sshd_config
RUN /etc/init.d/ssh restart
RUN pip3 install --upgrade pip
RUN pip install tensorflow-gpu==2.3.0
RUN pip install torch==1.4.0 torchvision==0.5.0
RUN pip install jupyter jupyterlab
RUN jupyter notebook --generate-config
RUN pip install matplotlib pillow lxml pandas Cython opencv-python openpyxl
RUN pip install scikit-image --upgrade
RUN apt-get install dbus-x11
RUN echo "X11Forwarding yes">> /etc/ssh/sshd_config
RUN echo "X11UseLocalhost no">> /etc/ssh/sshd_config
RUN grep "^X11UseLocalhost" /etc/ssh/sshd_config || echo "X11UseLocalhost no" >> /etc/ssh/sshd_config
RUN echo "service ssh start">>~/.bashrc
RUN echo "alias python='/usr/bin/python3'">>~/.bashrc
RUN echo "c.NotebookApp.terminado_settings = { 'shell_command': ['bash'] }">>/root/.jupyter/jupyter_notebook_config.py
RUN service ssh start
RUN wget https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.39_linux.run
RUN chmod +x cuda_10.1.105_418.39_linux.run
RUN sh cuda_10.1.105_418.39_linux.run --tar mxvf
sudo docker build -t="(your-name)/(image-name)" . --no-cache
sudo docker login
sudo docker push (your-name)/(image-name)
sudo docker logout
sudo docker exec -d [container name] /bin/bash [file]
ESP32-S3 是樂鑫科技(Espressif Systems)推出的一款高性能、低功耗的 MCU(微控制器單晶片),專為 AIoT(人工智慧物聯網)應用設計。 citeturn0search0
Apr 14, 2025魏子迪 長榮中學於1885年(清光緒十一年)由英國基督長老教會創辦臺灣第一所中學,當時校名『長老教中學』。 民國108年(西元2019年)十月,戴志勳主任接任第十任校長。 鍾承勳 謝喣茂 創校歷史: 長榮中學創立於1885年,由台灣基督長老教會所設立,是台灣歷史悠久的學校之一,致力於提供基督教精神的全人教育。這所學校的創校宗旨是結合基督教信仰與教育,培養全面發展的人才。 教育理念: 長榮中學秉持「誠、正、勤、樸」的校訓,強調品德教育,培養學生自主學習、創新思維及合作精神。這些核心價值觀不僅引導學生的學術追求,也塑造他們的品格。 校園環境:
Apr 11, 2025https://hackmd.io/@Titi/ByNUY-x2kx
Apr 10, 2025https://colab.research.google.com/
Mar 27, 2025or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up