序号 | 修订内容 | 修订时间 |
---|---|---|
1 | 新增 | 2021/1/20 |
本文主要介绍centos 8.1 安装cuda
[root@ussuritest004 ~]# cat /etc/centos-release
CentOS Linux release 8.1.1911 (Core)
[root@ussuritest004 ~]#
我这里用的是
cuda_10.2.89_440.33.01_linux.run
[root@ussuritest004 software]# lspci | grep -i nvidia
af:00.0 3D controller: NVIDIA Corporation TU104GL [Tesla T4] (rev a1)
[root@ussuritest004 software]#
此处先略
[root@ussuritest004 yum.repos.d]# yum install gcc
这个可以不要
[root@ussuritest004 yum.repos.d]# yum install libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev freeglut3-dev
[root@ussuritest004 log]# lsmod | grep nouveau
nouveau 2215936 1
mxm_wmi 16384 1 nouveau
video 45056 1 nouveau
wmi 32768 2 mxm_wmi,nouveau
i2c_algo_bit 16384 2 ast,nouveau
drm_kms_helper 217088 2 ast,nouveau
ttm 110592 2 ast,nouveau
drm 524288 7 drm_kms_helper,ast,ttm,nouveau
[root@ussuritest004 log]#
有输出表示启动了。
To disable the Nouveau drivers, creating a file at "/usr/lib/modprobe.d/blacklist-nouveau.conf" with following content:
blacklist nouveau
options nouveau modeset=0
[root@ussuritest004 ~]# ll /usr/lib/modprobe.d/blacklist-nouveau.conf
ls: cannot access ‘/usr/lib/modprobe.d/blacklist-nouveau.conf‘: No such file or directory
[root@ussuritest004 ~]# vim /usr/lib/modprobe.d/blacklist-nouveau.conf
[root@ussuritest004 ~]#
[root@ussuritest004 ~]# cat /usr/lib/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
[root@ussuritest004 ~]#
先备份
[root@ussuritest004 boot]# uname -r
4.18.0-147.el8.x86_64
[root@ussuritest004 boot]# cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak.orig
[root@ussuritest004 boot]# ll
total 167724
-rw-------. 1 root root 3838259 Dec 5 2019 System.map-4.18.0-147.el8.x86_64
-rw-r--r--. 1 root root 184613 Dec 5 2019 config-4.18.0-147.el8.x86_64
drwxr-xr-x. 3 root root 4096 Jan 19 11:44 efi
drwx------. 4 root root 4096 Jan 19 15:02 grub2
-rw-------. 1 root root 71694380 Jan 19 11:49 initramfs-0-rescue-c7dcb861dc20453f8e275d6036842581.img
-rw-------. 1 root root 30310567 Jan 19 11:50 initramfs-4.18.0-147.el8.x86_64.img
-rw------- 1 root root 30310567 Jan 20 13:50 initramfs-4.18.0-147.el8.x86_64.img.bak.orig
-rw-------. 1 root root 19141009 Jan 19 11:57 initramfs-4.18.0-147.el8.x86_64kdump.img
drwxr-xr-x. 3 root root 4096 Jan 19 11:47 loader
drwx------. 2 root root 16384 Jan 19 11:28 lost+found
-rwxr-xr-x. 1 root root 8106744 Jan 19 11:48 vmlinuz-0-rescue-c7dcb861dc20453f8e275d6036842581
-rwxr-xr-x. 1 root root 8106744 Dec 5 2019 vmlinuz-4.18.0-147.el8.x86_64
[root@ussuritest004 boot]#
再重新生成
[root@ussuritest004 boot]# dracut /boot/initramfs-$(uname -r).img --force
[root@ussuritest004 boot]# ll
total 166988
-rw-------. 1 root root 3838259 Dec 5 2019 System.map-4.18.0-147.el8.x86_64
-rw-r--r--. 1 root root 184613 Dec 5 2019 config-4.18.0-147.el8.x86_64
drwxr-xr-x. 3 root root 4096 Jan 19 11:44 efi
drwx------. 4 root root 4096 Jan 19 15:02 grub2
-rw-------. 1 root root 71694380 Jan 19 11:49 initramfs-0-rescue-c7dcb861dc20453f8e275d6036842581.img
-rw-------. 1 root root 29560525 Jan 20 13:53 initramfs-4.18.0-147.el8.x86_64.img
-rw------- 1 root root 30310567 Jan 20 13:50 initramfs-4.18.0-147.el8.x86_64.img.bak.orig
-rw-------. 1 root root 19141009 Jan 19 11:57 initramfs-4.18.0-147.el8.x86_64kdump.img
drwxr-xr-x. 3 root root 4096 Jan 19 11:47 loader
drwx------. 2 root root 16384 Jan 19 11:28 lost+found
-rwxr-xr-x. 1 root root 8106744 Jan 19 11:48 vmlinuz-0-rescue-c7dcb861dc20453f8e275d6036842581
-rwxr-xr-x. 1 root root 8106744 Dec 5 2019 vmlinuz-4.18.0-147.el8.x86_64
[root@ussuritest004 boot]#
[root@ussuritest004 boot]# systemctl set-default multi-user.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/multi-user.target.
[root@ussuritest004 boot]#
原文:https://www.cnblogs.com/weiwei2021/p/14302530.html