安裝stable diffusion webui過程中發(fā)現(xiàn)的問題。
出現(xiàn)報(bào)錯(cuò):
AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
然后來看nvidia-smi 的時(shí)候發(fā)現(xiàn)驅(qū)動掛了
1. nvcc -V,查看cuda是可以看到的
說明之前至少安裝cuda的時(shí)候沒掛,應(yīng)該是服務(wù)器啟動的問題。
2.??檢查了一下?
# whereis nvidia
nvidia: /usr/lib/nvidia /usr/share/nvidia /usr/src/nvidia-450.102.04/nvidia
# dkms status
nvidia, 450.102.04, 5.4.0-132-generic, x86_64: installed
說明驅(qū)動已經(jīng)安裝。不然的話可以用這個(gè)解決方案:?
sudo apt-get install dkms #DKMS全稱是Dynamic Kernel Module Support,它可以幫我們維護(hù)內(nèi)核外的這些驅(qū)動程序,在內(nèi)核版本變動之后可以自動重新生成新的模塊。
sudo dkms install -m nvidia -v 410.78 #410.78是安裝驅(qū)動的版本
?ubuntu關(guān)機(jī)開機(jī)后顯卡掛了:報(bào)錯(cuò)NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. M... - 簡書 (jianshu.com)(138條消息) NVIDIA驅(qū)動失效簡單解決方案:NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver._nvdia-smi has failed_AI 菌的博客-CSDN博客
3. 原因:linux系統(tǒng)內(nèi)核更新和nvidia驅(qū)動不適配
4. 解決方案:
(138條消息) 顯卡驅(qū)動報(bào)錯(cuò):NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver._顯卡報(bào)錯(cuò)命令是什么_oyrq的博客-CSDN博客
?期間遇到了另一個(gè)問題:
# sudo dkms install -m nvidia -v 450.102.04
Error! Your kernel headers for kernel 5.4.0-144-generic cannot be found.
Please install the linux-headers-5.4.0-144-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
檢查了一下確實(shí)沒裝:
# dpkg-query -s linux-headers-5.4.0-144-generic
dpkg-query: package 'linux-headers-5.4.0-144-generic' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
(138條消息) Linux如何查看內(nèi)核版本并安裝內(nèi)核頭文件linux-headers-generic_高精度計(jì)算機(jī)視覺的博客-CSDN博客
安裝:
?sudo apt-get install linux-headers-$(uname -r)
5. 最后再看nvidia-smi就沒問題了
?編輯文章來源:http://www.zghlxwxcb.cn/news/detail-663000.html
進(jìn)而也可以去解決下一個(gè)安裝stabel diffusion時(shí)出現(xiàn)的bug了:)文章來源地址http://www.zghlxwxcb.cn/news/detail-663000.html
到了這里,關(guān)于ubuntu服務(wù)器關(guān)機(jī)重新開機(jī)之后nvidia-smi不顯示但nvcc -C沒問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!