安装 pytorch
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install torchvision==0.10.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
pip install torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
https://download.pytorch.org/whl/cu111/torch-1.9.0%2Bcu111-cp38-cp38-linux_x86_64.whl
https://download.pytorch.org/whl/cu111/torchvision-0.10.0%2Bcu111-cp36-cp36m-linux_x86_64.whl
https://download.pytorch.org/whl/rocm4.2/torch-1.9.0%2Brocm4.2-cp36-cp36m-linux_x86_64.whl
安装显卡驱动报错
ERROR: The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding. Please consult the NVIDIA driver README and your Linux distribution's documentation
for details on how to correctly disable the Nouveau kernel driver.
WARNING: One or more modprobe configuration files to disable Nouveau are already present at: /usr/lib/modprobe.d/nvidia-installer-disable-nouveau.conf, /etc/modprobe.d/nvidia-installer-disable-nouveau.conf. Please be sure you have rebooted your
system since these files were written. If you have rebooted, then Nouveau may be enabled for other reasons, such as being included in the system initial ramdisk or in your X configuration file. Please consult the NVIDIA driver README and
your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.
ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com
WARNING: nvidia-installer was forced to guess the X library path '/usr/lib64' and X module path '/usr/lib64/xorg/modules'; these paths were not queryable from the
system. If X fails to find the NVIDIA X driver module, please install the `pkg-config` utility and the X.Org SDK/development package for your distribution
and reinstall the driver.
Installation of the kernel module for the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version 450.142.00) is now complete.
解决方案:
解决方法
1在配置文件中禁用nouveau
vi /etc/modprobe.d/blacklist.conf 添加:blacklist nouveau
vim /usr/lib/modprobe.d/dist-blacklist.conf
vim /lib/modprobe.d/dist-blacklist.conf
并且在加上
blacklist nouveau
options nouveau modeset=0
2. 备份原来的 initramfs nouveau image镜像
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
3. 创建新的 initramfs image镜像
dracut /boot/initramfs-$(uname -r).img $(uname -r)
所有安装已经完成,重新启动机器
安装显卡驱动:https://www.nvidia.com/Download/driverResults.aspx/178356/en-us
具体版本,自己选择好下载 根据自己的版本
sudo sh NVIDIA-Linux-x86_64-450.142.00.run
检测 是否安装成功
nvidia-smi
[root@11 cuda2]# nvidia-smi
Fri Aug 6 16:03:21 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.142.00 Driver Version: 450.142.00 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla T4 Off | 00000000:60:00.0 Off | 0 |
| N/A 62C P0 30W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 1 Tesla T4 Off | 00000000:61:00.0 Off | 0 |
| N/A 60C P0 30W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 2 Tesla T4 Off | 00000000:62:00.0 Off | 0 |
| N/A 63C P0 29W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 3 Tesla T4 Off | 00000000:64:00.0 Off | 0 |
| N/A 63C P0 31W / 70W | 0MiB / 15109MiB | 6% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+