尧图网站设计 尧图网站设计YAOTU DESIGN
ARTICLE DETAIL

资讯详情

深耕网站设计与一线实操的经验洞察。

5070Ti显卡下 安装ubuntu以及nvidia驱动等闭坑指南

5070Ti显卡下 安装ubuntu以及nvidia驱动等闭坑指南 5070Ti显卡比较新使用官网下载的驱动安装会有点问题前因后果会在后续慢慢补充这里写一份装驱动以及闭坑的问题合集。安装系统篇我的电脑配置如下(base) ➜ ~ screenfetch ./o- bananaubuntu yyyyy- -yyyyyy OS: Ubuntu 26.04 resolute :////////-yyyyyyo Kernel: x86_64 Linux 7.0.0-30-generic . .://-.sss/ Uptime: 6m .:o: //:--:/- Packages: 978 o:o:....-/oo/ Shell: zsh 5.9 .:o:o/. sssoo/ Disk: 470G / 938G (53%) ./:ooo: /sssooo. CPU: AMD Ryzen 9 5900X 12-Core 24x 4.95456GHz ///:ooo /::--:. GPU: NVIDIA GeForce RTX 5070 Ti \/ooo ////. RAM: 1008MiB / 30968MiB ..ooo: /dddhhh. ..ooo:. oddhhhh \.oo-.:ohdhhhhh :o ohhhhhhhhyoos: .o:.syhhhhhhh/.ooo /osyyyyyyoooo/ ooo\: oo.我的主板是TUF GAMING B550M-PLUS WIFI II之前没升级BIOS版本进入debian的安装界面后就一直黑屏在GRUB 启动菜单界面时输入临时解决安装命令能正常安装debian但是之后安装NVIDIA驱动的时候一直报错没找到正确的方式处理后来升级了BIOS到了最新转向使用ubuntu来解决这个问题。1.安装debian使用的临时命令在 GRUB 启动菜单界面按e编辑启动参数找到以linux开头的行在末尾添加以下参数后按CtrlX或F10启动参数修改找到以 linux 开头的行在末尾添加 nomodeset text modprobe.blacklistnouveau 若仍黑屏可追加 acpioff --------------------------------- - acpioff 绝对不要长期使用除了显卡还会导致CPU变频、风扇、主板外设异常 - nomodeset 仅限系统安装排错临时用正式系统启动必须移除。安装NVIDIA-Driver失败的命令是acpioff2.Ubuntu下载ubuntu下载 清华镜像源Index of /ubuntu-releases/26.04/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirrorventoy下载地址Download . Ventoy3.Ubuntu安装Ubuntu的安装比较简单Live版可注意安装mini-ubuntu之后按照需要的软件进行安装即可如果有安装失败等的原因会在这部分更新NVIDIA introduction:最开始我是想在debian上安装nvidia-driver的但是出现了很多问题NVIDIA-Drivers所需要的命令以及安装结果如下(base) ➜ ~ ssh banana192.168.31.167 banana192.168.31.167s password: Welcome to Ubuntu 26.04 LTS (GNU/Linux 7.0.0-30-generic x86_64) * Documentation: https://docs.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro 扩展安全维护ESMApplications 未启用。 134 更新可以立即应用。 要查看这些附加更新请运行apt list --upgradable 启用 ESM Apps 来获取未来的额外安全更新 请参见 https://ubuntu.com/esm 或者运行: sudo pro status Last login: Thu Aug 27 19:06:47 2026 from 192.168.31.19 bananaubuntu:~$ nvidia-smi Thu Aug 27 19:12:05 2026 ----------------------------------------------------------------------------------------- | NVIDIA-SMI 595.84 Driver Version: 595.84 CUDA Version: 13.2 | --------------------------------------------------------------------------------------- | 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 NVIDIA GeForce RTX 5070 Ti Off | 00000000:08:00.0 On | N/A | | 0% 38C P8 9W / 300W | 229MiB / 16303MiB | 0% Default | | | | N/A | --------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------- | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | || | 0 N/A N/A 2370 G /usr/bin/gnome-shell 186MiB | ----------------------------------------------------------------------------------------- bananaubuntu:~$ history 1 sudo apt install zsh git gcc g cmake make -y 2 lsmod | grep nouveau 3 sudo vim /etc/modprobe.d/blacklist.conf 4 sudo apt install vim -y 5 sudo vim /etc/modprobe.d/blacklist.conf 6 sudo update-initramfs -u 7 sudo reboot now 8 ip addr 9 sudo apt update 10 sudo apt install openssh-server -y 11 sudo apt list --upgradable 12 sudo add-apt-repository ppa:graphics-drivers/ppa 13 sudo apt update 14 ubuntu-drivers devices 15 sudo apt search nvidia-driver-595-open 16 sudo apt install nvidia-driver-595-open 17 nvidia-smi 18 sudo reboot now 19 nvidia-smi 20 history bananaubuntu:~$一、禁用nouveau驱动在Ubuntu系统中Nouveau开源驱动可能会与NVIDIA官方驱动产生冲突导致显卡功能受限或系统不稳定。本文将详细指导您如何正确禁用Nouveau驱动并安装NVIDIA官方驱动确保您的GPU能获得最佳性能。1. 检查当前驱动状态lsmod | grep nouveau如果输出显示nouveau模块说明当前正在使用开源驱动需要禁用。2. 禁用Nouveau驱动sudo gedit /etc/modprobe.d/blacklist.conf在文件末尾添加以下两行blacklist nouveau options nouveau modeset0保存文件后更新初始化RAM磁盘sudo update-initramfs -u二安装必要的环境以及编译工具sudo apt install gcc g make cmake build-essential -y三、添加ppa源以及安装open驱动sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update sudo apt install nvidia-driver-595-openbananaubuntu:~$ sudo apt search nvidia-driver-595-open [sudo: authenticate] 密码 nvidia-driver-595-open/resolute-updates,resolute-security,now 595.84-0ubuntu0.26.04.1 amd64 [已安装] NVIDIA driver (open kernel) metapackage bananaubuntu:~$ sudo apt install nvidia-driver-595-open 下列软件包是自动安装的并且现在不需要了 linux-headers-7.0.0-14 linux-main-modules-zfs-7.0.0-14-generic linux-tools-7.0.0-14-generic linux-headers-7.0.0-14-generic linux-modules-7.0.0-14-generic linux-image-unsigned-7.0.0-14-generic linux-tools-7.0.0-14 使用sudo apt autoremove来卸载它(它们)。 将要安装 nvidia-driver-595-open 将要安装的依赖 build-essential libfile-fcntllock-perl libvdpau1 ocl-icd-libopencl1 bzip2 libnvidia-cfg1-595 libxnvctrl0 pkg-config dkms libnvidia-common-595 lto-disabled-list pkgconf dpkg-dev libnvidia-compute-595 nvidia-compute-utils-595 pkgconf-bin fakeroot libnvidia-decode-595 nvidia-dkms-595-open screen-resolution-extra libalgorithm-diff-perl libnvidia-egl-wayland1 nvidia-firmware-595-595.84 xcvt libalgorithm-diff-xs-perl libnvidia-encode-595 nvidia-kernel-common-595 xserver-xorg-core libalgorithm-merge-perl libnvidia-extra-595 nvidia-kernel-source-595-open xserver-xorg-video-nvidia-595 libcrypt-dev libnvidia-fbc1-595 nvidia-prime libdpkg-perl libnvidia-gl-595 nvidia-settings libfakeroot libpkgconf7 nvidia-utils-595 建议安装 bzip2-doc debian-keyring bzr xfonts-100dpi xfonts-scalable menu debian-tag2upload-keyring nvidia-driver-595 | xfonts-75dpi 推荐安装 libnvidia-compute-595:i386 libnvidia-encode-595:i386 libnvidia-gl-595:i386 libnvidia-decode-595:i386 libnvidia-fbc1-595:i386 摘要 升级0安装42卸载0不升级142 下载大小319 MB 所需的空间981 MB / 938 GB 可用 是否继续 [Y/n] y -------------- Running depmod... done. 正在设置 nvidia-driver-595-open (595.84-0ubuntu0.26.04.1) ... 正在处理用于 gnome-menus (3.38.1-1ubuntu1) 的触发器 ... 正在处理用于 libc-bin (2.43-2ubuntu2.3) 的触发器 ... 正在处理用于 man-db (2.13.1-1build1) 的触发器 ... 正在处理用于 dbus (1.16.2-2ubuntu4) 的触发器 ... 正在处理用于 dracut (110-11) 的触发器 ... update-initramfs: Generating /boot/initrd.img-7.0.0-30-generic 正在处理用于 desktop-file-utils (0.28-1build1) 的触发器 ... bananaubuntu:~$ nvidia-smi NVIDIA-SMI has failed because it couldnt communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running. bananaubuntu:~$ sudo reboot now二、安装cuda官网寻找对应驱动的cuda下载CUDA Toolkit 13.2 Downloads | NVIDIA Developer这里我选择的是通过runfile安装wget https://developer.download.nvidia.com/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run sudo sh cuda_13.2.0_595.45.04_linux.runbananaubuntu:~$ wget https://developer.download.nvidia.com/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run --2026-08-27 19:23:01-- https://developer.download.nvidia.com/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run 正在解析主机 developer.download.nvidia.com (developer.download.nvidia.com)... 184.24.154.181, 184.24.154.170 正在连接 developer.download.nvidia.com (developer.download.nvidia.com)|184.24.154.181|:443... 已连接。 已发出 HTTP 请求正在等待回应... 301 Moved Permanently 位置https://developer.download.nvidia.cn/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run [跟随至新的 URL] --2026-08-27 19:23:01-- https://developer.download.nvidia.cn/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run 正在解析主机 developer.download.nvidia.cn (developer.download.nvidia.cn)... 36.153.62.132, 36.153.62.130, 36.153.62.131 正在连接 developer.download.nvidia.cn (developer.download.nvidia.cn)|36.153.62.132|:443... 已连接。 已发出 HTTP 请求正在等待回应... 200 OK 长度 4352114739 (4.1G) [application/octet-stream] 正在保存至: ‘cuda_13.2.0_595.45.04_linux.run’ cuda_13.2.0_595.45.04_linux.ru 100%[] 4.05G 40.5MB/s 用时 1m 55s 2026-08-27 19:24:57 (36.0 MB/s) - 已保存 ‘cuda_13.2.0_595.45.04_linux.run’ [4352114739/4352114739]) bananaubuntu:~$ sudo bash cuda_13.2.0_595.45.04_linux.run Summary Driver: Not Selected Toolkit: Installed in /usr/local/cuda-13.2/ Please make sure that - PATH includes /usr/local/cuda-13.2/bin - LD_LIBRARY_PATH includes /usr/local/cuda-13.2/lib64, or, add /usr/local/cuda-13.2/lib64 to /etc/ld.so.conf and run ldconfig as root To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-13.2/bin ***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 595.00 is required for CUDA 13.2 functionality to work. To install the driver using this installer, run the following command, replacing CudaInstaller with the name of this run file: sudo CudaInstaller.run --silent --driver Logfile is /var/log/cuda-installer.log还需要将cuda的环境变量添加到~/.bashrc或者~/.zshrc中# 配置cuda # 在 .bashrc 最后添加以下内容 export PATH/usr/local/cuda-13.2/bin${PATH::${PATH}} export LD_LIBRARY_PATH/usr/local/cuda-13.2/lib64${LD_LIBRARY_PATH::${LD_LIBRARY_PATH}} # 此处的13.2应该与你的安装的cuda一致source ~/.zshrc -------------- source ~/.bashrc nvcc -Vbananaubuntu:~$ wget https://developer.download.nvidia.com/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run --2026-08-27 19:23:01-- https://developer.download.nvidia.com/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run 正在解析主机 developer.download.nvidia.com (developer.download.nvidia.com)... 184.24.154.181, 184.24.154.170 正在连接 developer.download.nvidia.com (developer.download.nvidia.com)|184.24.154.181|:443... 已连接。 已发出 HTTP 请求正在等待回应... 301 Moved Permanently 位置https://developer.download.nvidia.cn/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run [跟随至新的 URL] --2026-08-27 19:23:01-- https://developer.download.nvidia.cn/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run 正在解析主机 developer.download.nvidia.cn (developer.download.nvidia.cn)... 36.153.62.132, 36.153.62.130, 36.153.62.131 正在连接 developer.download.nvidia.cn (developer.download.nvidia.cn)|36.153.62.132|:443... 已连接。 已发出 HTTP 请求正在等待回应... 200 OK 长度 4352114739 (4.1G) [application/octet-stream] 正在保存至: ‘cuda_13.2.0_595.45.04_linux.run’ cuda_13.2.0_595.45.04_linux.ru 100%[] 4.05G 40.5MB/s 用时 1m 55s 2026-08-27 19:24:57 (36.0 MB/s) - 已保存 ‘cuda_13.2.0_595.45.04_linux.run’ [4352114739/4352114739]) bananaubuntu:~$ sudo bash cuda_13.2.0_595.45.04_linux.run Summary Driver: Not Selected Toolkit: Installed in /usr/local/cuda-13.2/ Please make sure that - PATH includes /usr/local/cuda-13.2/bin - LD_LIBRARY_PATH includes /usr/local/cuda-13.2/lib64, or, add /usr/local/cuda-13.2/lib64 to /etc/ld.so.conf and run ldconfig as root To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-13.2/bin ***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 595.00 is required for CUDA 13.2 functionality to work. To install the driver using this installer, run the following command, replacing CudaInstaller with the name of this run file: sudo CudaInstaller.run --silent --driver Logfile is /var/log/cuda-installer.log bananaubuntu:~$ vim ~/.bashrc bananaubuntu:~$ tail -n 10 ~/.bashrc . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi # 配置cuda # 在 .bashrc 最后添加以下内容 export PATH/usr/local/cuda-13.2/bin${PATH::${PATH}} export LD_LIBRARY_PATH/usr/local/cuda-13.2/lib64${LD_LIBRARY_PATH::${LD_LIBRARY_PATH}} # 此处的13.2应该与你的安装的cuda一致 bananaubuntu:~$ source ~/.bashrc bananaubuntu:~$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2026 NVIDIA Corporation Built on Mon_Mar_02_09:52:23_PM_PST_2026 Cuda compilation tools, release 13.2, V13.2.51 Build cuda_13.2.r13.2/compiler.37434383_0完整的安装记录如上命令三、安装llama.cppbananaubuntu:~$ git clone https://github.com/ggml-org/llama.cpp.git 正克隆到 llama.cpp... remote: Enumerating objects: 118053, done. remote: Counting objects: 100% (772/772), done. remote: Compressing objects: 100% (361/361), done. remote: Total 118053 (delta 602), reused 432 (delta 411), pack-reused 117281 (from 2) 接收对象中: 100% (118053/118053), 424.32 MiB | 8.29 MiB/s, 完成. 处理 delta 中: 100% (82929/82929), 完成.cmake -B build -DGGML_CUDAON cmake --build build --config Release -j$(nproc)四、安装ohmyzsh注意安装玩ohmyzsh后需要将cuda的环境变量写到~/.zshrc中然后重新更新不然llama.cpp找不到cuda安装在本地克隆后获取安装脚本。git clone https://mirrors.cernet.edu.cn/ohmyzsh.git cd ohmyzsh/tools REMOTEhttps://mirrors.cernet.edu.cn/ohmyzsh.git sh install.sh切换已有 ohmyzsh 至镜像源git -C $ZSH remote set-url origin https://mirrors.cernet.edu.cn/ohmyzsh.git git -C $ZSH pull完整的安装记录bananaubuntu:~$ git clone https://mirrors.cernet.edu.cn/ohmyzsh.git cd ohmyzsh/tools REMOTEhttps://mirrors.cernet.edu.cn/ohmyzsh.git sh install.sh 正克隆到 ohmyzsh... warning: 重定向到 https://mirror.nju.edu.cn/git/ohmyzsh.git/ remote: Enumerating objects: 36491, done. remote: Counting objects: 100% (13424/13424), done. remote: Compressing objects: 100% (3798/3798), done. remote: Total 36491 (delta 12596), reused 9626 (delta 9626), pack-reused 23067 接收对象中: 100% (36491/36491), 10.65 MiB | 4.67 MiB/s, 完成. 处理 delta 中: 100% (21453/21453), 完成. Cloning Oh My Zsh... warning: 重定向到 https://mirror.nju.edu.cn/git/ohmyzsh.git/ remote: Enumerating objects: 1748, done. remote: Counting objects: 100% (1748/1748), done. remote: Compressing objects: 100% (1636/1636), done. remote: Total 1748 (delta 211), reused 994 (delta 82), pack-reused 0 接收对象中: 100% (1748/1748), 3.39 MiB | 7.53 MiB/s, 完成. 处理 delta 中: 100% (211/211), 完成. 来自 https://mirrors.cernet.edu.cn/ohmyzsh * [新分支] add-docker-compose-config - origin/add-docker-compose-config * [新分支] copilot/docker-plugin-load-fix - origin/copilot/docker-plugin-load-fix * [新分支] copilot/fix-per-directory-history-regression - origin/copilot/fix-per-directory-history-regression * [新分支] copilot/pr-13984-fix-marcs-comment - origin/copilot/pr-13984-fix-marcs-comment * [新分支] master - origin/master * [新分支] rr-13813-introduce-cooldown-feature - origin/rr-13813-introduce-cooldown-feature 分支 master 设置为跟踪 origin/master。 已经位于 master /home/banana/ohmyzsh/tools Looking for an existing zsh config... Using the Oh My Zsh template file and adding it to /home/banana/.zshrc. Time to change your default shell to zsh: Do you want to change your default shell to zsh? [Y/n] Y Changing your shell to /usr/bin/zsh... [sudo: authenticate] 密码 Shell successfully changed to /usr/bin/zsh. __ __ ____ / /_ ____ ___ __ __ ____ _____/ /_ / __ \/ __ \ / __ __ \/ / / / /_ / / ___/ __ \ / /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / \____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ /____/ ....is now installed! Before you scream Oh My Zsh! look over the .zshrc file to select plugins, themes, and options. • Follow us on X: https://x.com/ohmyzsh • Join our Discord community: https://discord.gg/ohmyzsh • Get stickers, t-shirts, coffee mugs and more: https://commitgoods.com/collections/oh-my-zsh ➜ tools git:(master)五、安装miniconda#miniconda 国内镜像源 查找最新的x86_64的安装包 https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/ ----- wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py314_26.5.3-2-Linux-x86_64.sh bash Miniconda3-py314_26.5.3-2-Linux-x86_64.sh ----- 一路按yes 和enter确认装完以后退出当前的终端然后重新连接ubuntu-server修改~/.condarc给conda提供国内镜像源 清华源channels: - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud升级pypipython -m pip install -i https://mirrors.cernet.edu.cn/pypi/web/simple --upgrade pip pip config set global.index-url https://mirrors.cernet.edu.cn/pypi/web/simple六 modelscopepip install modelscope modelscope download --model unsloth/Qwen3.8-27B-GGUF Qwen3.8-27B-UD-Q4_K_M.gguf --local_dir ./dir我习惯去modelscope里面查找神经网络模型国内另一个网站是HF-Mirror七、测试llama.cpp(base) ➜ llama.cpp git:(master) ./build/bin/llama-bench -m /home/banana/modelscope/dir/Qwen3.8-27B-UD-Q3_K_XL.gguf -p 4096 -n 512 ggml_cuda_init: found 1 CUDA devices (Total VRAM: 15838 MiB): Device 0: NVIDIA GeForce RTX 5070 Ti, compute capability 12.0, VMM: yes, VRAM: 15838 MiB | model | size | params | backend | ngl | test | t/s | | ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: | | qwen35 27B Q3_K - Large | 12.23 GiB | 27.32 B | CUDA | -1 | pp4096 | 1643.33 ± 9.69 | | qwen35 27B Q3_K - Large | 12.23 GiB | 27.32 B | CUDA | -1 | tg512 | 32.78 ± 0.01 | build: fe235f434 (10650)八、OpenCodecurl -fsSL https://opencode.ai/install | bash(base) ➜ ~ curl -fsSL https://opencode.ai/install | bash Installing opencode version: 1.18.23 ######################################################################## 100.0% Successfully added opencode to $PATH in /home/banana/.zshrc ▄ █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█ █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀ ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ OpenCode includes free models, to start: cd project # Open directory opencode # Run command For more information visit https://opencode.ai/docsToDo九、DockerTsinghua镜像源 安装Docker的方法Docker Ce | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror安装完 Docker加入用户组的方法sudo groupadd docker sudo gpasswd -a ${USER} docker sudo service docker restart sudo chmod arw /var/run/docker.sock
返回列表