欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 国际 > Debian 11 裸机初始化与环境配置指南

Debian 11 裸机初始化与环境配置指南

2024/10/25 19:55:49 来源:https://blog.csdn.net/weixin_43744732/article/details/143106343  浏览:    关键词:Debian 11 裸机初始化与环境配置指南

裸机Debian 11初始化步骤

1. 更新APT的镜像,加快APT下载速度

使用阿里云镜像替换默认的Debian源,加速软件包下载:

sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
apt update

2. 安装SSHD以便远程访问

首先更新APT包管理器并安装openssh-server

apt update
apt install openssh-server

接着备份并修改sshd配置文件以允许root登录和密码认证:

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config

为root用户设置密码:

passwd root

创建运行目录并设置权限:

mkdir -p /run/sshd
chmod 0755 /run/sshd

启动sshd服务:

nohup /usr/sbin/sshd -e &

如果之前登录过并且需要清除旧的SSH密钥:

ssh-keygen -R xxx.xxx.xxx.xxx

连接到SSHD服务:

ssh root@xxx.xxx.xxx.xxx

3. Debian 11安装CUDA和NVIDIA驱动

首先更新系统并安装必备工具:

apt update && apt install sudo -y
apt install gcc g++ cmake pkg-config linux-headers* wget kmod

安装NVIDIA驱动

如果没有NVIDIA驱动,下载并运行NVIDIA驱动程序:

wget https://us.download.nvidia.com/XFree86/Linux-x86_64/530.30.02/NVIDIA-Linux-x86_64-530.30.02.run
sh NVIDIA-Linux-x86_64-530.30.02.run

如遇以下错误:

ERROR: Unable to find the module utility `modprobe`; please make sure you have the package 'module-init-tools' or 'kmod' installed. If you do have 'module-init-tools' or 'kmod' installed, then please check that `modprobe` is in your PATH.

解决方法是安装kmod

apt install kmod -y

安装CUDA

下载并安装CUDA:

wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run
sudo sh cuda_12.1.0_530.30.02_linux.run

配置环境变量:

vim ~/.bashrc

在文件末尾添加以下内容:

export PATH=$PATH:/usr/local/cuda-12.1/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.1/lib64

使配置生效:

source ~/.bashrc

验证CUDA安装:

nvcc -V

4. 安装Conda

下载并安装Miniconda:

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

添加清华镜像源:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

5. 安装Git及Git LFS

使用APT安装Git和Git LFS:

apt install git
apt install git-lfs

6. 使用PIP安装相关依赖

使用PIP安装以下依赖包:

pip install xxx

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com