# Nvidia_Tesla_P4_P40_Manual_For_Debian_12
适用于 Linux Debian 12 安装Tesla P4 P40等GPU的显卡Cuda和驱动
Suitable for Linux Debian 12 to install graphics card Cuda and driver for Tesla P4 P40 and other GPUs
在pve 8.2中使用q35(不可使用i440fx)机型创建的虚拟机中安装Nvidia gpu驱动的教程。
Tutorial for installing Nvidia gpu drivers in a virtual machine created with the q35 (not available with i440fx) model in pve 8.2.


## 检查显卡存在
通常可以使用 lspci 命令来识别已安装显卡的 NVIDIA 图形处理单元 (GPU) 系列/代号。例如:
You can usually use the lspci command to identify the NVIDIA graphics processing unit (GPU) family/codename of an installed graphics card. For example:
```bash
$ lspci | grep NVIDIA
```
## 为apt允许非自由软件源
Allow non-free software sources for apt
```bash
for non-Chinese users:
vim.tiny /etc/apt/sources.list
Add "contrib", "non-free" and "non-free-firmware" components to /etc/apt/sources.list, for example:
# Debian Bookworm
deb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
```
```bash
# 对于中国用户更换清华tuna源:
vim.tiny /etc/apt/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
```
### 更新apt
### Update apt
```bash
apt update -y
```
## 安装显卡驱动
```bash
apt install nvidia-driver firmware-misc-nonfree
```
重启电脑
### 检查 Debian 12 上是否安装了显卡驱动
```bash
nvidia-smi
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI |
|-----------------------------------------+----------------------+----------------------+
| 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 P4 On | 00000000:03:00.0 Off | Off |
| N/A 38C P8 6W / 75W | 0MiB / 8192MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
```
显卡驱动已安装完毕
## 安装Cuda
install Cuda
```bash
apt install nvidia-cuda-dev nvidia-cuda-toolkit
```
### 检查 Debian 12 上是否安装了 NVIDIA CUDA
```bash
nvcc --version
```
## 安装 NVIDIA cuDNN
install cuDNN
```bash
apt install nvidia-cudnn
```
看到窗口后,按 <Enter> 键同意。
Once you see the window, press <Enter> to agree the license.
NVIDIA cuDNN 库需要从 NVIDIA 官方网站下载。需要一段时间。
NVIDIA cuDNN libraries are being downloaded from the official website of NVIDIA. It takes a while to complete.
## 关闭ECC
Turn off ECC
通过```nvidia-smi | grep Tesla```查看前面GPU编号
```bash
d@d:/fuck$ nvidia-smi | grep Tesla
| 0 Tesla P40 On | 00000000:03:00.0 Off | Off |
-----------------------------------------------------------------------------------------
nvidia-smi -i n -e 0/1 可关闭(0)/开启(1) , n是GPU的编号。
```
执行关闭ECC```sudo nvidia-smi -i 0 -e 0```重启后该设置生效。

好家伙VCC
- 粉丝: 2827
- 资源: 9136
最新资源
- matlab实现四旋翼无人机自抗扰姿态容错控制-飞行器控制-四旋翼无人机-自抗扰控制-UAV-扰动识别-matlab
- 基于主从博弈的综合能源微网与共享储能优化运行研究:迭代算法探索与利益相关者的博弈策略,基于主从博弈的综合能源微网与共享储能优化运行研究:电价策略与用户行为互动,matlab 代码基于主从博弈的共享储能
- 14章RAG全栈技术从基础到精通 ,打造高精准AI应用
- MATLAB平台下的多目标粒子群算法在冷热电联供综合能源系统优化中的实践,基于多目标粒子群算法的冷热电联供综合能源系统优化调度模型,MATLAB代码:基于多目标粒子群算法冷热电联供综合能源系统运行优化
- 三相桥式全控整流及其有源逆变与Simulink仿真波形分析(含不同触发角和负载变化图),三相桥式全控整流及其有源逆变与Simulink仿真探究:触发角与负载变化下的波形图分析,三相桥式全控整流及其有源
- 中国智能制造装备产业发展机遇蓝皮书 2024.pdf
- 【毕业设计】Python的Django-html网易新闻+评论的舆情热点分析平台源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 西门子1200 PLC与昆仑通态上位软件结合的新能源物料输送系统程序案例解析,V16+博图版本,RS485通讯控制托利多称重仪表模拟量读取技术实现,西门子S1200博图物料输送系统:新能源物料输送PL
- 【毕业设计】Python的Django-html图像的信息隐藏技术研究源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html深度学习的车牌识别系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html深度学习屋内烟雾检测方法源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 灰狼算法在微电网优化调度中的应用:考虑风光储与需求响应的多元经济优化策略,模型可塑性强且出图丰富的实践研究,灰狼算法在微电网风光储需求响应优化调度中的应用:经济性优化与模型可塑性的研究分析图集,灰狼算
- 【毕业设计】Python的Django-html人脸识别的实验室智能门禁系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html深度学习的身份证识别考勤系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html时间序列分析的大气污染预测系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- matlab实现遗传算法在物流中心配送路径规划中的应用-遗传算法-路径规划-物流配送-最佳配送方案-matlab
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


