实践设备:华硕FX-PRO(NVIDIA GeForce GTX 960M)
搭建PyTorch环境的详细步骤如下:
1.安装Ubuntu系统:
- 下载Ubuntu的镜像文件并制作启动盘。
- 将启动盘插入计算机,启动计算机并按照提示安装Ubuntu系统。
2.配置镜像源,安装必要环境:
这里以添加清华大学的镜像源地址为例,具体细节请参考https://blog.csdn.net/qq_37592750/article/details/138258932。
2.1.打开终端(Ctrl+Alt+T)。
2.2.使用文本编辑器编辑sources.list文件。注释掉原有的源地址(在每一行前加上#)。
2.3.添加清华大学的镜像源地址。以Ubuntu 20.04为例,可以添加以下内容:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
2.4.运行以下命令更新系统:
sudo apt update
3.安装NVIDIA驱动和CUDA工具:
(此步骤具体细节安装配置请参考《UEFI安全启动模式下安装Ubuntu的NVIDIA显卡驱动》):