table of Contents
2. Install chrome, input method
4. Install the graphics card driver and the higher version of cuda
6. Install docker and nvidia-docker
7. Install the graphics card driver on the new Lenovo machine
0. Target environment
windows+ubuntu共存
nvidia driver
cuda
nvidia-docker
pycharm
chrome
python3.8
pip
1. Install dual systems
Because this machine has its own windows system, here is the direct use of u disk to install the ubuntu system.
1) Make a USB flash drive for ubuntu20.04
UltralSo+ official website download system+u disk
2) Installation
https://blog.csdn.net/zr459927180/article/details/51627910
The resolution cannot be adjusted during installation, and when the partition option is not visible: https://www.zhihu.com/question/299230727
2. Install chrome, input method
chrome:https://blog.csdn.net/snowdream86/article/details/106160498
Input:
https://pinyin.sogou.com/linux/?r=pinyin
https://www.cnblogs.com/Areas/p/13438171.html
https://zhuanlan.zhihu.com/p/142206571
3. Install gcc
https://blog.csdn.net/m0_37412775/article/details/109355044
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
sudo apt-get -y install gcc-7 g++-7
change gcc version:https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa
4. Install the graphics card driver and the higher version of cuda
cp cuda/lib64/* /usr/local/cuda-11.1/lib64/
cp cuda/include/* /usr/local/cuda-11.1/include/
1) Download and install the graphics driver
https://blog.csdn.net/Thanlon/article/details/106125738
2) Install cuda-11.1.0
https://blog.csdn.net/qq_36999834/article/details/107589779
3) Install cudnn
wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda_11.1.0_455.23.05_linux.run
sudo sh cuda_11.1.0_455.23.05_linux.run
reference:
https://blog.csdn.net/qq_33200967/article/details/80689543
5. Install pycharm
https://www.jetbrains.com/pycharm/download/other.html
https://blog.csdn.net/feimeng116/article/details/105837483
cp pycharm-professional-2019.3.5.tar.gz /home/xxx/software
tar -zxvf pycharm-professional-2019.3.5.tar.gz -C ./software/pycharm-2019.3/
6. Install docker and nvidia-docker
https://docs.docker.com/engine/install/ubuntu/
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#nvidia-drivers
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
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 \
bionic \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo docker run hello-world
sudo usermod -aG docker gmt
sudo systemctl restart docker
sudo systemctl status docker
docker --version
curl https://get.docker.com | sh && sudo systemctl --now enable docker
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-docker2
sudo systemctl restart docker
Import your previous nvidia-docker image and create a container:
sudo docker load -i tensorflow.tar
sudo docker images # 查看导入的images
sudo sh ./tf_dep/debug.sh # 创建新容器
# debug.sh
#!/bin/bash
nvidia-docker run -m 8GB -it --net=host \
-v /home/***/tensorflow/:/root \
--name tensorflow tensorflow:v2 /bin/bash
7. Install the graphics card driver on the new Lenovo machine
After trying the following, nvidia-smi cannot find the graphics card driver:
1)ubuntu16.04、ubuntu18.04、ubuntu20.04
2) Different kernel versions 5.4 and 5.8
3) Use dmesg to view the kernel log
4) Graphics card driver installation method (image interface installation, terminal installation), high and low version
5) After installing different versions of cuda.
The last successful step:
1) Enter Ctrl+Alt+F1 into bios and modify secure boot to disabled;
2) The ubuntu option in the startup item, enter the system with the 5.4.0 kernel (here you need to install the kernel yourself);
3) Install gcc 7, g++ 7;
4) Uninstall the driver installed before, autoinstall
The command is as follows:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
sudo apt-get -y install gcc-7 g++-7
sudo apt-get remove --purge nvidia*
sudo ubuntu-drivers autoinstall
sudo reboot
Note: It may be that I have installed too many cuda versions, which are not consistent with the previous ones. It will be seen, the difference is not big.
8. Install pip
The python3.8 that comes with the ubuntu system does not seem to have pip, so you should install it yourself. For those using python, this must be present.
sudo apt install -y python3-pip
reference:
https://blog.csdn.net/smcaa/article/details/86482872
https://blog.csdn.net/cskywit/article/details/85211884