{"id":95,"date":"2024-04-17T21:37:15","date_gmt":"2024-04-17T13:37:15","guid":{"rendered":"https:\/\/yanghaixiong.com\/?p=95"},"modified":"2025-01-17T03:14:40","modified_gmt":"2025-01-16T19:14:40","slug":"aigc-%e5%ae%9e%e6%88%98%ef%bc%88%e7%8e%af%e5%a2%83%e7%af%87%ef%bc%89-exsi-8-0-debian%e5%ae%89%e8%a3%85rtx3060%e6%98%be%e5%8d%a1%e9%a9%b1%e5%8a%a8","status":"publish","type":"post","link":"https:\/\/yanghaixiong.com\/blog\/aigc\/95\/","title":{"rendered":"AIGC \u5b9e\u6218\uff08\u73af\u5883\u7bc7\uff09 – EXSI 8.0 Debian\u5b89\u88c5RTX3060\u663e\u5361\u9a71\u52a8"},"content":{"rendered":"\n
\u8fd1\u671f\uff0c\u5c1d\u8bd5\u5728\u5bb6\u91cc\u670d\u52a1\u4e2d\u642d\u5efa\u4e00\u4e2a\u7528\u6765\u8dd1 AI \u7684\u670d\u52a1\u5668\uff0c\u5c1d\u8bd5\u4f7f\u7528 EXSI8.0 + ubuntu \u642d\u5efa\uff0c\u56e0 exsi + ubuntu \u65e0\u6cd5\u5b89\u88c5\u6700\u65b0\u7248\u672c N \u5361\u9a71\u52a8\uff0c\u539f\u56e0\uff1a\u5b89\u88c5\u4e0a\u540e\uff0cnvidia-smi \u627e\u4e0d\u5230\u8bbe\u5907\uff0cexsi+ubuntu \u7684\u65b9\u5f0f\u884c\u4e0d\u901a\uff0c\u6240\u4ee5\u6539\u4e3a exsi+debian \u7684\u65b9\u5f0f\u642d\u5efa\u3002
\n\u865a\u62df\u673a\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n
\u9996\u5148\u914d\u7f6e\u865a\u62df\u673a\uff0c\u6309\u8bbe\u7f6e\uff1a<\/p>\n
hypervisor.cpuid.v0=FALSE<\/code><\/li>\n- \u8bbe\u7f6e
pciPassthru0.msiEnabled=FALSE<\/code><\/li>\n- \u8bbe\u7f6e
pciPassthru.use64bitMMIO=TRUE<\/code><\/li>\n- \u8bbe\u7f6e
pciPassthru.64bitMMIOSizeGB=24<\/code>\uff08\u8fd9\u4e2a\u6570\u5b57\u586b\u5199 2*GPU \u663e\u5b58\u603b\u91cf\u3002\u4f8b\u5982\u6211\u7684 3060 \u663e\u5b58 12G\uff0c\u8fd9\u91cc\u586b\u5199 24 \u5373\u53ef\uff09<\/li>\n<\/ul>\n\u5728\u865a\u62df\u673a\u5185\uff0c\u9996\u5148\u914d\u7f6e apt \u6e90\uff0c\u4f7f\u4e4b\u5305\u542b non-free-firmware<\/code>\u3002\u5728 \/etc\/apt\/source.list<\/code> \u4e2d\uff0c\u6dfb\u52a0 non-free-firmware<\/code>\uff0c\u5b8c\u6210\u540e\u5e94\u8be5\u5f62\u5982\uff1a<\/p>\ndeb https:\/\/deb.debian.org\/debian\/ bookworm main contrib non-free non-free-firmware\n<\/code><\/pre>\n\u7136\u540e\uff0c<\/p>\n
sudo apt update\napt search nvidia-driver\n<\/code><\/pre>\n\u76f4\u63a5\u4f7f\u7528 apt \u5b89\u88c5\u9a71\u52a8\uff0c\u4f1a\u51fa\u73b0\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n
Detected NVIDIA GPUs:\n1b:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA102 [GeForce RTX 3090] [10de:2204] (rev a1)\n\nChecking card: NVIDIA Corporation GA102 [GeForce RTX 3090] (rev a1)\nUh oh. Your card is not supported by any driver version up to 545.23.06.\nA newer driver may add support for your card.\nNewer driver releases may be available in backports, unstable or experimental.\n<\/code><\/pre>\n\u89e3\u51b3\u65b9\u6848<\/h3>\n
\u7b80\u5355\u6765\u8bf4\uff0c\u9700\u8981\u5b89\u88c5\u5f00\u653e\u7248\u672c\u7684 NVIDIA \u9a71\u52a8\u800c\u4e0d\u662f\u9ed8\u8ba4\u7684\u3002\u8bba\u575b\u4e2d\u7684\u56de\u7b54\u8868\u793a\u5e94\u8be5\u4f7f\u7528 .run<\/code> \u6587\u4ef6\u5b89\u88c5\uff0c\u5e76\u9644\u52a0\u53c2\u6570 -m=kernel-open<\/code>\uff0c\u6211\u4e0d\u6e05\u695a\u662f\u5426\u6709\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684 deb \u5305\u3002
\n\u5728\u5e94\u7528\u8fd9\u4e2a\u65b9\u6848\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u6e05\u7406\u4e4b\u524d\u7684\u5b89\u88c5\u3002<\/p>\nsudo nvidia-uninstall\nsudo apt purge -y '^nvidia-*' '^libnvidia-*'\nsudo rm -r \/var\/lib\/dkms\/nvidia\nsudo apt -y autoremove\nsudo update-initramfs -c -k uname -r<\/code>\nsudo update-grub2\nsudo reboot\n<\/code><\/pre>\n\n- \u68c0\u67e5\u663e\u5361\u662f\u5426\u88ab\u7cfb\u7edf\u8bc6\u522b<\/li>\n<\/ol>\n
lspci | grep -i nvidia\n<\/code><\/pre>\n\n- \u68c0\u67e5\u64cd\u4f5c\u7cfb\u7edf\u662f\u5426\u5f00\u542f nouveau<\/li>\n<\/ol>\n
lsmod | grep nouveau\n<\/code><\/pre>\n\n- \u7981\u7528\u5185\u6838\u6a21\u5757 nouveau<\/li>\n<\/ol>\n
vim \/etc\/modprobe.d\/blacklist-nvidia-nouveau.conf\n\n\u6dfb\u52a0\uff1a\nblacklist nouveau\noptions nouveau modeset=0\n<\/code><\/pre>\n\n- \u65b0\u589e\u663e\u5361\u53c2\u6570<\/li>\n<\/ol>\n
vim \/etc\/modprobe.d\/nvidia.conf\n\n\u6dfb\u52a0\uff1a\n\noptions nvidia NVreg_OpenRmEnableUnsupportedGpus=1\n<\/code><\/pre>\n\n- \u66f4\u65b0 initramfs<\/li>\n<\/ol>\n
sudo update-initramfs -u\n<\/code><\/pre>\n\n- \u91cd\u542f\u540e\uff0c\u68c0\u6d4b\u3002\u6ca1\u4efb\u4f55\u8f93\u51fa\uff0c\u5219\u7981\u7528\u6210\u529f<\/li>\n<\/ol>\n
systemctl reboot\nlsmod | grep nouveau \n# \u6ca1\u6709\u8f93\u51fa\u8bf4\u660e\u64cd\u4f5c\u6210\u529f\n<\/code><\/pre>\n\n- \u7136\u540e\uff0c\u4ece NVIDIA \u9a71\u52a8\u4e0b\u8f7d\u7ad9\u4e0b\u8f7d
.run<\/code> \u683c\u5f0f\u7684\u9a71\u52a8\u3002\u5e76\u6267\u884c<\/li>\n<\/ol>\nsudo apt-get install gcc make g++ #\u5b89\u88c5\u4f9d\u8d56\nsudo chmod u+x NVIDIA-Linux-x86_64-535.154.05.run #\u8d4b\u4e88\u53ef\u6267\u884c\u6743\u9650\nsudo .\/NVIDIA-Linux-x86_64-535.154.05.run -m=kernel-open\nsudo update-initramfs -u\nsystemctl reboot\nnvidia-smi\n<\/code><\/pre>\n1.The distribution-provided pre-install script failed! Are you sure you want to continue? \n\n\u201cYes\u201d\n\n2.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?\n\n\u201cNo\u201d\n\n3.Nvidia\u2019s 32-bit compatibility libraries?\n\n\u201cNo\u201d\n\n4.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. \n\n\u201cYes\u201d\n\n<\/code><\/pre>\n\u5982\u679c\u9047\u5230 nvidia driver \u9047\u5230 kernel source tree missing \u7684\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n
sudo apt-get install linux-headers-$(uname -r)\n\u7ed3\u679c\u544a\u8bc9\u6211\u6ca1\u6709\u8fd9\u4e2a\u5305\u3002\n\n\u7136\u540e\u6211\u8fd0\u884c\n\nsudo apt-cache search linux-headers-$(uname -r)\n\n\u663e\u793a\u7684\u5934\u6587\u4ef6\u7248\u672c\u662f4.19.0-6-amd64\n\n\u800c\u6211\u7684\u6838\u5fc3\n\ncat \/proc\/version\n\n\u662f4.19.0-5\n\n\u56e0\u6b64\u53ea\u80fd\u5347\u7ea7\u6838\u5fc3\n\nsudo apt-get install linux-image-4.19.0-6-amd64\n\n\u7136\u540e\u5378\u8f7d\u539f\u6765\u7684\uff0c\u8fd9\u65f6\u5019\u4f1a\u6709\u8b66\u544a\uff0c\u53ea\u8981\u9009No\u5373\u53ef\n\nsudo apt-get remove linux-image-4.19.0-5-amd64\n\n\u5378\u8f7d\u5b8c\u4e86\u91cd\u542f\u5373\u53ef\n<\/code><\/pre>\n\u91cd\u542f\u95ee\u9898\u89e3\u51b3<\/p>\n
<\/p>\n
RTX 3060 CUDA\u3001CUDNN \u5b89\u88c5<\/h2>\nCUDA \u5b89\u88c5<\/h3>\n
\u6309\u7167 NVIDIA CUDA\u5b89\u88c5\u6587\u6863<\/a>\uff0c\u5b89\u88c5 CUDA\uff1a<\/p>\nwget https:\/\/developer.download.nvidia.com\/compute\/cuda\/12.3.2\/local_installers\/cuda-repo-debian12-12-3-local_12.3.2-545.23.08-1_amd64.deb\n\nsudo dpkg -i cuda-repo-debian12-12-3-local_12.3.2-545.23.08-1_amd64.deb\n\nsudo cp \/var\/cuda-repo-debian12-12-3-local\/cuda-*-keyring.gpg \/usr\/share\/keyrings\/\n\nsudo add-apt-repository contrib\n\u5982\u679ccommand not found\n\u6267\u884c\uff1aapt-get install software-properties-common\n\nsudo apt-get update\nsudo apt-get -y install cuda-toolkit-12-3\n\n<\/code><\/pre>\n\u6267\u884c\u5b8c\u4e0a\u8ff0\u4ee3\u7801\u540e\uff0c\u6267\u884c nvcc –version \u663e\u793a command not found\uff0c\u5219\u4e0b\u9762\u6b65\u9aa4\u89e3\u51b3\uff1a
\n\u9996\u5148\uff0c\u67e5\u770b cuda \u7684 bin \u76ee\u5f55\u4e0b\u662f\u5426\u6709 nvcc\uff1a<\/p>\n
cd \/usr\/local\/cuda\/bin\n<\/code><\/pre>\n\u5982\u679c\u5b58\u5728\uff0c\u76f4\u63a5\u5c06 cuda \u8def\u5f84\u52a0\u5165\u7cfb\u7edf\u8def\u5f84\u5373\u53ef\uff1a<\/p>\n
vim ~\/.bashrc\n\u8fdb\u5165\u914d\u7f6e\u6587\u4ef6\uff1b\n\u6dfb\u52a0\u4ee5\u4e0b\u4e24\u884c\uff1a\nexport PATH=\/usr\/local\/cuda\/bin:$PATH\nexport LD_LIBRARY_PATH=\/usr\/local\/cuda\/lib64:$LD_LIBRARY_PATH\n<\/code><\/pre>\n\u7136\u540e\u66f4\u65b0\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n
source ~\/.bashrc\n<\/code><\/pre>\n\u518d\u6b21\u6267\u884c nvcc —version<\/a> \u5c31\u53ef\u4ee5\u770b\u5230\u76f8\u5e94 cuda \u7248\u672c\u4e86\uff0c\u5982\u4e0b\uff1a<\/p>\n
<\/p>\n
CUDNN \u5b89\u88c5<\/h3>\n
\u00a0\u200b\u5728 NVIDIA CUDNN<\/a>, \u8fd9\u91cc\u4e0b\u8f7d deb \u683c\u5f0f (\u672c\u6587\u662f debian \u7cfb\u7edf\uff09\uff0c\u5b89\u88c5\uff1a<\/p>\nsudo dpkg -i cudnn-local-repo-debian11-8.9.7.29_1.0-1_amd64.deb \nsudo cp \/var\/cudnn-local-repo-ubuntu2204-8.6.0.163\/cudnn-local-FAED14DD-keyring.gpg \/usr\/share\/keyrings\/ \nsudo apt-get update \nsudo apt-get install libcudnn8=8.9.7.29-1+cuda12.2 # \u8fd9\u91cc\u8f93\u5165\u5230=\u6309tab\u8865\u5168\u5373\u53ef\uff0c\u5b89\u88c5\u8fd0\u884c\u5e93 \nsudo apt-get install libcudnn8-dev=8.9.7.29-1+cuda12.2 # \u901a\u8fc7tab\u81ea\u52a8\u8865\u5168\uff0c\u5b89\u88c5developer \u5e93 \nsudo apt-get install libcudnn8-samples=8.9.7.29-1+cuda12.2 # \u901a\u8fc7tab\u81ea\u52a8\u8865\u5168\uff0c\u5b89\u88c5\u793a\u4f8b\u548c\u6587\u6863\n<\/code><\/pre>\n\u6d4b\u8bd5\uff1a<\/p>\n
cp -r \/usr\/src\/cudnn_samples_v8\/ $HOME \ncd ~\/cudnn_samples_v8\/mnistCUDNN\/ \nmake clean && make \n# \u5982\u679c\u63d0\u793a\u4e0b\u9762\u622a\u56fe\u4e2d\u7684\u9519\u8bef\uff0c\u5c31\u6267\u884c\u4e0b\u9762\u8bed\u53e5\u5b89\u88c5freeimage3\u5e93 \nsudo apt-get install libfreeimage3 libfreeimage-dev\n<\/code><\/pre>\n
\n\u8fd0\u884c\u6d4b\u8bd5\uff1a<\/p>\n
.\/mnistCUDNN\n<\/code><\/pre>\n
<\/p>\n
\u53c2\u8003\u6587\u7ae0<\/h3>\n\n- ESXi6.7\u5b9e\u73b0\u76f4\u901a\u72ec\u663e\uff08RTX 3060\uff09\u7ed9Ubuntu\u70bc\u4e39<\/a><\/li>\n
- Ubuntu22.04+Nvidia\u9a71\u52a8+Cuda11.8+cudnn8.6<\/a><\/li>\n
- \u4e00\u4efd\u4fdd\u59c6\u7ea7\u7684 Stable Diffusion \u90e8\u7f72\u6559\u7a0b\uff0c\u5f00\u542f\u4f60\u7684\u70bc\u4e39\u4e4b\u8def | \u4eac\u4e1c\u4e91\u6280\u672f\u56e2\u961f<\/a><\/li>\n
- ESXi \u4e2d\u7684 Debian \u865a\u62df\u673a\u5b89\u88c5 NVIDIA \u663e\u5361\u9a71\u52a8<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"
\u8fd1\u671f\uff0c\u5c1d\u8bd5\u5728\u5bb6\u91cc\u670d\u52a1\u4e2d\u642d\u5efa\u4e00\u4e2a\u7528\u6765\u8dd1 AI \u7684\u670d\u52a1\u5668\uff0c\u5c1d\u8bd5\u4f7f\u7528 EXSI8.0 + ubuntu \u642d\u5efa\uff0c\u56e0 exsi + ubuntu \u65e0\u6cd5\u5b89\u88c5\u6700\u65b0\u7248\u672c N \u5361\u9a71\u52a8\uff0c\u539f\u56e0\uff1a\u5b89\u88c5\u4e0a\u540e\uff0cnvidia-smi \u627e\u4e0d\u5230\u8bbe\u5907\uff0cexsi+ubuntu \u7684\u65b9\u5f0f\u884c\u4e0d\u901a\uff0c\u6240\u4ee5\u6539\u4e3a exsi+debian \u7684\u65b9\u5f0f\u642d\u5efa\u3002 \u865a\u62df\u673a\u914d\u7f6e\u5982\u4e0b\uff1a EPYC 7302 * 48 \u57fa\u4e8e ESXi-8.0U2 \u5e73\u53f0 NVIDIA GeForce RTX 3060\uff0812G\uff09 128G \u5185\u5b58 Debian GNU\/Linux 12 (bookworm) x86_64 RTX 3060 \u663e\u5361\u9a71\u52a8\u5b89\u88c5 \u4e3b\u8981\u8fc7\u7a0b \u9996\u5148\u914d\u7f6e\u865a\u62df\u673a\uff0c\u6309\u8bbe\u7f6e\uff1a […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[198],"series":[],"class_list":["post-95","post","type-post","status-publish","format-standard","hentry","category-aigc","tag-esxi"],"yoast_head":"\n
AIGC \u5b9e\u6218\uff08\u73af\u5883\u7bc7\uff09 - EXSI 8.0 Debian\u5b89\u88c5RTX3060\u663e\u5361\u9a71\u52a8 - \u6ce2\u6bd4AI<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n