WSL2安裝CUDA
在WSL里面不用安裝顯卡驅(qū)動,顯卡驅(qū)動必須要提前在Windows系統(tǒng)里面安裝好,安裝好后相應(yīng)庫文件會自動映射到WSL里面
-
進入網(wǎng)站
-
找到自己需要的版本,我這里是CUDA 11.7.1,點擊進入詳細頁面
-
依次選擇 L i n u x → x 86 _ 64 → W S L ? U b u n t u → 2.0 → r u n f i l e Linux\rightarrow x86\_64\rightarrow WSL-Ubuntu\rightarrow 2.0\rightarrow runfile Linux→x86_64→WSL?Ubuntu→2.0→runfile
-
復(fù)制下面生成的命令,粘貼到shell執(zhí)行
-
什么都不用改,直接選擇安裝
-
查看安裝日志,按照指導(dǎo)添加環(huán)境變量
export PATH=/usr/local/cuda-11.7/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-11.7/lib64
-
Pytorch檢查CUDA可用性,打開ipython:
import torch torch.cuda.is_available() torch.version.cuda torch.tensor(12.)
文章來源:http://www.zghlxwxcb.cn/news/detail-572419.html
圖片轉(zhuǎn)存中…(img-FYqbxIPl-1689521657766)]文章來源地址http://www.zghlxwxcb.cn/news/detail-572419.html
到了這里,關(guān)于WSL2安裝CUDA的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!