Before bloggers special column Ubuntu in is installed on the virtual machine. Here the blogger has integrated a dual system, so we need to reconfigure the Ubuntu environment. Here is a simple record of the process:
1. Prepare the operating system ubuntu-20.04.2.0-desktop-amd64 ISO, USB flash disk startup disk making tool. After starting the disk, it can be installed from USB flash disk. The installation steps after the system is up are similar to those under the virtual machine. For details, please refer to My blog
2. After the operation, basically input the update source, apt update and upgrade, install aptitude, install some necessary libraries, set the fast access path of the folder, add common software to the desktop, etc. see Blog , because you also need to write a blog on this system, so on this basis, a Baidu ingyin is installed. I think it's very useful. You can refer to this Blog.
3. The Screenshot tool can use the Screenshot software of Ubuntu, and the drawing software can use Kolourpaint
sudo apt-get install kolourpaint4
The opening interface is as follows
4. Some common commands are as follows:
For common commands under ubuntu, please refer to:
Common shell commands under ubuntu - my dream is like a rainbow - blog Garden
LINUX Shell common commands_ LH0912666 blog - CSDN blog_ Shell command
5. The installation of wechat and qq can be seen in the blog Install wechat and QQ for Ubuntu 20.04_ Hongxuan's column - CSDN blog_ ubuntu wechat
ubuntu20.04 install wechat to solve the problem of Chinese display - Zhihu
6. How to create interface shortcuts see blog https://jingyan.baidu.com/article/7e440953ff08496ec0e2efda.html
7. Installing remote tools for bloggers ToDesk remote control software - free safe and smooth remote connection to computer and mobile phone , it can be configured according to the official website
8. Set background picture
9. Mount other disks under Windows for reference Attach the hard disk of windows to the dual system ubuntu_ Show me code CSDN blog_ Mount windows hard disk with ubuntu
10. Install Anaconda
Anaconda | The World's Most Popular Data Science Platform
Click get started on the official website to enter the download page
The old version of Anaconda can be downloaded on the following page
Anaconda3-5.2.0-linux-x86 is used here_ Version 64.sh can be installed directly according to the following posts
Ubuntu18.04 installing Anaconda3_ Dream Dancing blog - CSDN blog_ ubuntu installing Anaconda
Enter python after restart
To uninstall Anaconda, refer to 2020-11-02-Ubuntu 20.04 install anaconda3 uninstall anaconda3 notes_ Er Ye's blog CSDN blog_ Ubuntu uninstall anaconda3
11. Install cuda and cudnn
For the introduction of cuda and cudnn, please refer to the previous blog
Can refer to Install CUDA and cuDNN for Ubuntu 18.04 - Zhihu To install cuda and cudnn, you can also refer to the following blog
Driver unloading Refer to Ubuntu uninstall nvidia driver - Tang Miao - blog Park
The following commands can query some information
lspci | grep -i nvidia sudo dpkg --list | grep nvidia-* nvidia-smi
A cuda built-in example is executed, and the following information is output, indicating that cuda installation is successful
To uninstall cuda, see this blog ubuntu uninstalls cuda completely_ Venquieu blog - CSDN blog_ ubuntu uninstalling cuda
The cuda version installed here is 11.0
The blogger has installed tensorflow GPU (version 2.4)
import tensorflow as tf sess = tf.compat.v1.Session()
After execution, the following output statement appears, indicating that cuda and cudnn have been configured successfully
tf.compat.v1.Session() 2022-02-18 23:40:05.605991: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set 2022-02-18 23:40:05.606716: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1 2022-02-18 23:40:05.628902: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:05.629048: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties: pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1660 Ti with Max-Q Design computeCapability: 7.5 coreClock: 1.335GHz coreCount: 24 deviceMemorySize: 5.80GiB deviceMemoryBandwidth: 268.26GiB/s 2022-02-18 23:40:05.629064: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-02-18 23:40:05.631140: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.11 2022-02-18 23:40:05.631175: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.11 2022-02-18 23:40:05.632029: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10 2022-02-18 23:40:05.632223: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10 2022-02-18 23:40:05.634402: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.10 2022-02-18 23:40:05.634916: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.11 2022-02-18 23:40:05.635023: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.8 2022-02-18 23:40:05.635107: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:05.635291: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:05.635411: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0 2022-02-18 23:40:05.636312: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set 2022-02-18 23:40:05.636406: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:05.636535: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties: pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1660 Ti with Max-Q Design computeCapability: 7.5 coreClock: 1.335GHz coreCount: 24 deviceMemorySize: 5.80GiB deviceMemoryBandwidth: 268.26GiB/s 2022-02-18 23:40:05.636550: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-02-18 23:40:05.636564: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.11 2022-02-18 23:40:05.636576: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.11 2022-02-18 23:40:05.636588: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10 2022-02-18 23:40:05.636599: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10 2022-02-18 23:40:05.636610: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.10 2022-02-18 23:40:05.636621: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.11 2022-02-18 23:40:05.636633: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.8 2022-02-18 23:40:05.636677: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:05.636823: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:05.636932: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0 2022-02-18 23:40:05.636958: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-02-18 23:40:06.063093: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix: 2022-02-18 23:40:06.063124: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0 2022-02-18 23:40:06.063131: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0: N 2022-02-18 23:40:06.063298: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:06.063472: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:06.063609: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-02-18 23:40:06.063721: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4953 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce GTX 1660 Ti with Max-Q Design, pci bus id: 0000:01:00.0, compute capability: 7.5) <tensorflow.python.client.session.Session object at 0x7f22082f4780> >>>
It can be compared with the installation of cuda, cudnn and verification process on windows. See my previous blog Cuda8 under win7 0 install tensorflow running gpu_ Jiugeshao's column - CSDN blog_ cuda8.0 win7
You can see the library of the tensorflow GPU just installed in the following location
12.Anaconda configuring virtual environments
Refer to the above blog, which can be used to create conda environment
conda create -n pytorch-yolo python=3.8 activate pytorch-yolo
Add command of Tsinghua source
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
Other operation commands can be found in the following blog
Anaconda installation and basic operation of CONDA_ u010206379 blog - CSDN blog_ anaconda conda
13. python version switching
Multi version python switching on raspberry pie 4B (I)_ jiugeshao's column - CSDN blog
Multi version python switching on raspberry pie 4B (II)_ jiugeshao's column - CSDN blog
The previous blog mentioned the switching of python version. Under Anaconda, you can also create a virtual environment through conda mentioned above
As can be seen from the above, the configuration of deep learning environment under Ubuntu desktop system is not very different from that under windows system, and the operation habits are the same. The next blog will configure pytorch in this system environment