centos重装

1、echo $CUDA_HOME

2、设置挂载

1
2
3
4
5
6
7
8
9
sudo mkdir /data

sudo mount /dev/nvme0n1 /data

sudo mkdir Users

sudo mount /dev/nvme1n1 /Users

sudo vim /etc/fstab

3、设置开机自动挂载

1
sudo vim /etc/fstab

(2条消息) /etc/fstab 参数详解及如何设置开机自动挂载_码农-CSDN博客

4、删除不必要文件夹

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
rm -rf Documents
rm -rf Downloads
rm -rf Music
rm -rf Pictures
rm -rf Templates
rm -rf Desktop
rm -rf Public
rm -rf Videos

rm -rf 下载
rm -rf 公共
rm -rf 图片
rm -rf 文档
rm -rf 模板
rm -rf 桌面
rm -rf 视频
rm -rf 音乐

5、安装显卡驱动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
wget https://us.download.nvidia.com/XFree86/Linux-x86_64/460.73.01/NVIDIA-Linux-x86_64-460.73.01.run

mv NVIDIA-Linux-x86_64-460.73.01.run ~/
#系统信息
sudo lshw -C display

lsmod | grep nouveau

sudo yum -y update

sudo yum -y groupinstall "GNOME Desktop"

sudo yum -y install kernel-devel epel-release dkms gcc gcc-g++

chmod a+x NVIDIA-Linux-x86_64-460.73.01.run

sudo init 3

sudo sh ./NVIDIA-Linux-x86_64-460.73.01.run --no-opengl-files

nvidia-smi

更改内核

Centos7修改默认启动内核 - lazyll - 博客园 (cnblogs.com)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
rpm -qa | grep kernel
vim /boot/grub/grub.cfg
cat /boot/grub2/grub.cfg | grep kernel-3.10.0-1160.el7.x86_64
cat /boot/grub/grub.cfg | grep kernel-3.10.0-1160.el7.x86_64
cat /boot/grub/grub.cfg | grep kernel-3.10.0-
cat /boot/grub/grub.cfg | grep kernel-3.10.
cat /boot/grub/grub.cfg | 3.10.
cat /boot/grub/grub.cfg | grep 3.10.
cat /boot/grub/grub.cfg | grep 3.10.0-1160.el7.x86_64
540 grub2-editenv list
541 grub-editenv list
542 sudo grub2-editenv list
543 sudo grub2-set-default 3.10.0-1160.el7.x86_64
544 sudo grub2-editenv list
545 mv /boot/grub/grub.cfg /boot/grub/grub.cfg.bak
546 sudo mv /boot/grub/grub.cfg /boot/grub/grub.cfg.bak
547 grub2-mkconfig -o /boot/grub/grub.cfg
548 sudo grub2-mkconfig -o /boot/grub/grub.cfg
549 sudo grub2-editenv list

禁用显卡驱动

1
2
3
4
5
6
7
8
禁用
sudo modprobe -b nouveau

lsmod | grep nouveau

sudo sh ./NVIDIA-Linux-x86_64-460.73.01.run --no-opengl-files
卸载
sudo modprobe -r nouveau

安装docker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

sudo yum repolist -v

sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm

sudo systemctl --now enable docker

sudo systemctl enable docker

307 sudo yum install docker-ce -y
308 sudo systemctl --now enable docker
309 sudo docker run --rm hello-world
310 distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \\n && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo
311 sudo yum clean expire-cache
312 sudo yum install -y nvidia-docker2
313 sudo systemctl restart docker

sudo cat /etc/group | grep docker

sudo usermod -aG docker CG

docker info

docker container ls -a

sudo mount -t nfs 10.8.130.30:/CG /nas

sudo yum install -y openssl openssh-server

sudo gedit /etc/ssh/sshd_config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
history
1 ls
2 cd .Deploy
3 ls
4 cat install-oh-my-zsh.sh
5 cp ./.zshrc ~/
6 cp ./.p10k.zsh ~/
7 ln -s .myexport.zsh ~/
8 vim .zshrc
9 rm .myexport.zsh
10 cp ~/.Deploy/.myexport.zsh .
11 sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
12 作者:岸边露伴一动不动
13 链接:https://www.jianshu.com/p/556ff130fc65
14 来源:简书
15 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
16 sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
17 作者:岸边露伴一动不动
18 链接:https://www.jianshu.com/p/556ff130fc65
19 来源:简书
20 rm -rf .oh-my-zsh
21 sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
22 clear
23 cd .Deploy
24 ls
25 cat install-oh-my-zsh.sh
26 yum -y install zsh
27 sudo yum -y install zsh
28 ls
29 cat install-oh-my-zsh.sh
30 sh ./install-from-git.sh
31 ls
32 cat .p10k.zsh
33 clear
34 ls
35 cat .p10k.zsh
36 cat .zshrc
37 ls
38 cd .Deploy
39 ls
40 cat install-
41 cat install-oh-my-zsh.sh
42 zsh --version
43 cd
44 wget https://sourceforge.net/projects/zsh/files/zsh/5.8/zsh-5.8.tar.xz/download
45 ls
46 mv download zsh.tar.xz
47 ls
48 tar Jxvf FileName.tar.xz
49 tar Jxvf zsh.tar.xz
50 ls
51 cd zsh-5.8
52 ls
53 osinfo-install-script
54 ls
55 ./install-sh
56 sudo
57 yum -y install gcc perl-ExtUtils-MakeMaker
58 sudo
59 yum -y install gcc perl-ExtUtils-MakeMaker
60 sudo yum -y install gcc perl-ExtUtils-MakeMaker
61 sudo
62 sudo yum -y install ncurses-devel
63 ls
64 ./configure
65 make && make install
66 sudo make && sudo make install
67 ls
68 cd
69 sudo vim /etc/shells
70 whereis zsh
71 ls
72 cd Desktop
73 ls
74 cd
75 cd .Deploy
76 ls
77 source ./install-from-git.sh
78 cd .Deploy
79 source ./install-from-git.sh
80 sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
81 rm -rf .oh-my-zsh
82 sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
83 ls
84 cd .Deploy
85 ls
86 source install-from-git.sh
87 zsh --version
88 clear
89 ls
90 cat install-oh-my-zsh.sh
91 cp ./.zshrc ~/
92 cp ~/.p10k.zsh ~/
93 ln -s .myexport.zsh ~/
94 cd
95 rm .myexport.zsh
96 cd .Deploy
97 ls
98 ln -s .myexport.zsh ~/
99 ls
100 cd
101 zsh --version
102 vim .zshrc
103 ls
104 cd .Deploy
105 ls
106 cat install-oh-my-zsh.sh
107 usermod -s /usr/local/bin/zsh $(whoami)
108 sudo usermod -s /usr/local/bin/zsh $(whoami)
109 ls
110 cat .myexport.zsh
111 ls
112 vim ~/.Deploy
113 rm .myexport.zsh
114 cp ~/.Deploy/.myexport.zsh ./
115 ls
116 echo $CUDA
117 cat .m
118 cat .myexport.zsh
119 echo $CUDA_HOME
120 ls
121 clear
122 ls
123 clear
124 ls
125 clear
126 cd /da
127 cd
128 cd /
129 ks
130 mkdir data
131 ls
132 sudo mkdir data
133 sudo mkdir /data
134 ls
135 cd data
136 ls
137 clear
138 ls
139 df -h
140 sudo fdisk -h
141 sudo fdisk -l
142 sudo mount /dev/nvme0n1 /data
143 ls
144 cd /data
145 ls
146 clear
147 ls
148 clear
149 ls
150 sudo vim /etc/fstab
151 ll
152 df -h
153 vim /etc/fstab
154 sudo vim /etc/fstab
155 sudo fdisk -l
156 sudo mount /dev/nvme1n1 /Users
157 cd ..
158 ls
159 mkdir /Users
160 sudo mkdir Users
161 sudo mount /dev/nvme1n1 /Users
162 ls
163 cd Us
164 cd Users
165 ls
166 cd docker
167 ls
168 clear
169 ls
170 cd
171 clear
172 ls
173 rm zsh.tar.xz
174 ls
175 rm -rf zsh-5.8
176 ls
177 clear
178 ls
179 rm -rf Documents
180 rm -rf Downloads
181 ls
182 rm -rf Music
183 rm -rf Pictures
184 rm -rf Templates
185 ls
186 rm -rf Desktop
187 rm -rf Public
188 ls
189 rm -rf Videos
190 ls
191 ll
192 ls
193 clear
194 ls
195 cd /data
196 ls
197 lspci | grep -i vga
198 wget https://us.download.nvidia.com/XFree86/Linux-x86_64/460.73.01/NVIDIA-Linux-x86_64-460.73.01.run
199 ls
200 ll
201 mv NVIDIA-Linux-x86_64-460.73.01.run ~/
202 ls
203 lshw -C display
204 sudo lshw -C display
205 lsmod | grep nouveau
206 vim /etc/default/grub
207 yum -y update
208 sudo yum -y update
209 ls
210 clear
211 ls
212 ll
213 ls
214 clear
215 yum -y update
216 sudo yum -y update
217 sudo yum -y install kernel-devel epel-release dkms gcc gcc-g++
218 sudo reboot
219 ls
220 clear
221 history
222 ls
223 ll
224 ls
225 clear
226 ls
227 history
228 ssh CG@10.7.45.35
229 ls
230 clear
231 ls
232 clear
233 lspci | grep -i nvidia
234 clear
235 yum -y update
236 sudo yum -y update
237 yum -y install kernel-devel epel-release dkms gcc gcc-g++
238 sudo yum -y groupinstall "GNOME Desktop"
239 yum -y install kernel-devel epel-release dkms gcc gcc-g++
240 sudo yum -y install kernel-devel epel-release dkms gcc gcc-g++
241 clear
242 ls
243 lsmod | grep nouveau
244 sudo vim /etc/default/grub
245 cat /etc/default/grub
246 grub2-mkconfig -o /boot/grub2/grub.cfg
247 sudo grub2-mkconfig -o /boot/grub2/grub.cfg
248 sudo vim /etc/modprobe.d/blacklist.conf
249 mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
250 sudo mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
251 dracut /boot/initramfs-$(uname -r).img $(uname -r)
252 sudo dracut /boot/initramfs-$(uname -r).img $(uname -r)
253 ls
254 clear
255 rm -rf 下载
256 rm -rf 公共
257 rm -rf 图片
258 rm -rf 文档
259 rm -rf 模板
260 rm -rf 桌面
261 rm -rf 视频
262 rm -rf 音乐
263 ls
264 clear
265 sudo reboot
266 ls
267 clear
268 ls
269 clear
270 ls
271 clear
272 ls
273 lsmod | grep nouveau
274 chmod a+x NVIDIA-Linux-x86_64-460.73.01.run
275 ls
276 init 3
277 ls
278 sh ./NVIDIA-Linux-x86_64-460.73.01.run --no-opengl-files
279 sudo sh ./NVIDIA-Linux-x86_64-460.73.01.run --no-opengl-files
280 sudo init 3
281 sudo sh ./NVIDIA-Linux-x86_64-460.73.01.run --no-opengl-files
282 clear
283 nvidia-smi
284 clear
285 ls
286 nvidia-smi
287 sudo yum remove docker \\n docker-client \\n docker-client-latest \\n
docker-common \\n docker-latest \\n docker-latest-logrotate \\n
docker-logrotate \\n docker-selinux \\n docker-engine-selinux \\n
docker-engine
288 sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
289 sudo yum repolist -v
290 sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm
291 sudo systemctl --now enable docker
292 clear
293 ls
294 sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm
295 sudo yum repolist -v
296 sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm
297 sudo systemctl --now enable docker
298 ls
299 cd
300 ls
301 systemctl enable docker
302 sudo systemctl --now enable docker
303 sudo systemctl enable docker
304 su -
305 sudo docker run --rm hello-world
306 docker
307 sudo yum install docker-ce -y
308 sudo systemctl --now enable docker
309 sudo docker run --rm hello-world
310 distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \\n && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo
311 sudo yum clean expire-cache
312 sudo yum install -y nvidia-docker2
313 sudo systemctl restart docker
314 cd /etc
315 ls
316 cd docker
317 ls
318 vim daemon.json
319 cd /Us
320 cd /Users
321 ls
322 cd docker
323 ls
324 cd lib
325 ls
326 cd docker
327 ls
328 pwd
329 cd /etc
330 ls
331 cd docker
332 ls
333 vim daemon.json
334 sudo vim daemon.json
335 sudo systemctl restart docker
336 docker info
337 sudo docker info
338 sudo cat /etc/group | grep docker
339 sudo usermod -aG docker CG
340 ls
341 docker info
342 clear
343 ls
344 clear
345 docker container ls -a
346 ls
347 mount -t nfs 10.8.130.30:/CG /nas
348 sudo mount -t nfs 10.8.130.30:/CG /nas
349 ls
350 cd /nas
351 ls
352 cd /nas
353 ls
354 apt-get
355 dnf
356 history
357 yum
358 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm_size 1g chy/
359 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g chy/
360 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g chy/test:latest /bin/bash
361 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest /bin/bash
362 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest bash
363 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest
364 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest bin/bash
365 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest bash
366 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest
367 docker run --runtime nvidia -it -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest bin/bash
368 docker run -it --runtime nvidia -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest bash
369 docker run -it --runtime nvidia -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g cby/test:latest --entrypoint /bin/bash
370 docker run -it --runtime nvidia -p 12560:22 -v /data:/data -v /nas:/nas --shm-size 1g --entrypoint /bin/bash cby/test:latest