Ubuntu20.04服务器使用教程(安装教程、常用命令、故障排查)持续更新中.....

安装教程(系统、NVIDIA驱动、CUDA、CUDNN、Pytorch、Timeshift、ToDesk)

  1. 制作U盘启动盘,并安装系统
  • MSDN i tell you下载Ubuntu20.04 Desktop 版本,并使用Rufus制作UEFI启动盘,参考UEFI安装Ubuntu
  • 使用GPT+UEFI模式安装,记得更改主板选项Legacy to EFI support 为 enable
  1. 安装NVIDIA显卡驱动
  • 先参考Ubuntu20.04下深度学习环境配置,配置apt-get换国内阿里源

  • 参考Ubuntu18-22.04安装和干净卸载nvidia显卡驱动------超详细、最简单中的方法二,使用系统自带的 "软件和更新" 程序 - 附加驱动,选择带有recommend的驱动,进行安装

  • 安装过程中可能会出现的问题

     1.The distribution-provided pre-install script failed! Are you sure you want to continue?
    
     选择continue installation
    
     2.Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?  
    
     选择 No 继续。
    
     3.问题没记住,选项是:install without signing
    
     4.问题大概是:Nvidia's 32-bit compatibility libraries? 
     
     选择 No 继续。
    
     5.Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up.  
    
     选择 Yes  继续
    
  • 验证

python 复制代码
//执行此语句,出现显卡信息则证明安装成功。
nvidia-smi
  1. 安装Anaconda
  • 参考Ubuntu20.04下深度学习环境配置,安装Anaconda
  • "Do you accept the license terms", 输入"yes"
  • "Do you wish the installer to initialize Anaconda3 by running condo init?", 输入"no"
  1. 安装Pytorch-cpu
  1. 安装CUDA
  1. 安装CUDNN
  • 即使不在新建的conda虚拟环境中安装,如在base中安装CUDNN,其他的虚拟环境也能正常使用
  • 参考Ubuntu20.04下深度学习环境配置,安装CUDNN
  • 在输入以下代码时,前一个cuda是解压CUDNN后的目录,而cuda-xxx表示,将xxx更改为上一步安装cuda的版本号,具体可以打开目录 /user/local 进行查看。
python 复制代码
sudo cp cuda/include/cudnn*.h /usr/local/cuda-xxx/include/
 
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-xxx/lib64/
 
sudo chmod a+r /usr/local/cuda-xxx/include/cudnn*.h /usr/local/cuda-xxx/lib64/libcudnn*
  1. 安装Pytorch
  1. 安装Timeshift
  1. 安装ToDesk
  • 由于向日葵在切换Ubuntu账号时会黑屏,暂时找不到解决办法,所以使用ToDesk
  • 安装方法,参考ToDesk官网

常用命令

  1. 为普通用户添加sudo权限、删除sudo权限的方法,参考Ubuntu系统上为用户授予和删除sudo权限的方法
  2. 桌面卡死解决办法,参考Ubuntu桌面卡死解决办法
  3. 关闭SSH窗口后,使模型继续运行,参考screen命令解决SSH远程服务器训练代码断开连接后运行中断
  4. 实时查看CPU、GPU温度,参考Ubuntu 系统实时查看CPU温度和GPU温度
  5. 实时查看CPU占用率,参考(top命令)如何使用各种工具和命令来检查 Ubuntu 中的 CPU 使用情况?

故障排查

  1. 服务器被陌生IP访问,查看是否被入侵:
相关推荐
likfishdn10 分钟前
Linux的文件与目录管理
linux·运维·服务器
渲染101专业云渲染12 分钟前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean30 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=32 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
若云止水41 分钟前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_init_cycle 函数 - 详解(4)
数据库·nginx·ubuntu
橘子味的茶二41 分钟前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
北京耐用通信1 小时前
航空装配自动化神器Ethercat转profient网关搭配机器人精准控制
运维·机器人·自动化