日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > windows >内容正文

windows

win10安装wsl 2.0子系统 安装在非C盘

發(fā)布時間:2023/12/14 windows 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 win10安装wsl 2.0子系统 安装在非C盘 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1. 安裝在C盤的方法

以下教程安裝在C盤

(254條消息) Win10下安裝配置使用WSL2_RenLJ1895的博客-CSDN博客_win10 安裝wsl2

2. 安裝在非C盤的方法

(254條消息) win10安裝子系統(tǒng)(wsl)到非C盤,其它盤的方法_Locutus的博客-CSDN博客_win10子系統(tǒng)安裝到其他盤

(254條消息) WSL1升級至WSL2_goldVitaminC的博客-CSDN博客_wsl1升級到wsl2

?2.1 我的安裝過程:

打開子系統(tǒng)選項和虛擬機(jī):

# 子系統(tǒng) dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart # 虛擬機(jī) dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

修改win配置:

打開控制面版,查看方式選擇大圖標(biāo),再點擊程序與功能—>啟用或關(guān)閉Windows功能,檢查下圖中紅框圈出內(nèi)容是否均以打?qū)?#xff1b;若沒有,則需要打?qū)床Ⅻc擊確定

?重啟,更新配置

鏈接:https://pan.baidu.com/s/14MVfl9g1iCJoSxPp_9susQ?
提取碼:18ei

下載好如下文件:

?powershell管理員方式運行:

./ubuntu2004.exe

運行完成,查看版本號:

wsl -l -v # 結(jié)果NAME STATE VERSION * Ubuntu-20.04 Stopped 1

下載版本更新包,并運行:

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

?更新版本設(shè)置:

wsl --set-version Ubuntu-20.04 2wsl -l -v# 結(jié)果NAME STATE VERSION * Ubuntu-20.04 Stopped 2

?使用一:下載mobaxterm,他自動適配wsl子系統(tǒng)

使用二:vscode

下載擴(kuò)展 remote ssh,打開 wsl targets即可啟動ubuntu系統(tǒng)

使用三:命令行啟動

# 運行: wsl --distribution Ubuntu-20.04 #或者 wsl -d Ubuntu-20.04# 查看 wsl -l --runningWindows Subsystem for Linux Distributions: Ubuntu-20.04 (Default)# 停止 wsl -t Ubuntu-20.04 # 或者 wsl --terminate Ubuntu-20.04

更新源:

# 備份 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak # 打開 sudo vim /etc/apt/sources.list # 將源文件內(nèi)容全部注釋,并添加以下任意源# 阿里源 deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse# 清華源 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security multiverse# 保存,退出,更新源 sudo apt-get update# 更新文件 sudo apt-get dist-upgrade sudo apt-get upgrade

?與windos文件系統(tǒng)的聯(lián)系,該子系統(tǒng)已經(jīng)自動掛在了win的文件系統(tǒng),在/mnt下

以上參考如下教程:

(254條消息) Win10下安裝配置使用WSL2_RenLJ1895的博客-CSDN博客_win10 安裝wsl2

3. 配置桌面

3.1 vncviewer

(254條消息) win10用vncviewer遠(yuǎn)程登陸ubuntu桌面_vieo的博客-CSDN博客_vnc遠(yuǎn)程桌面 win10

3.1 方法二,用mobaxterm

4. 安裝驅(qū)動

nvidia官方文檔:CUDA on WSL :: CUDA Toolkit Documentation (nvidia.com)

特別說明:

?不要質(zhì)疑,選windows;;另外開發(fā)人員用studio、玩游戲用game版本

cuda安裝:選wsl版本

CUDA Toolkit 11.6 Update 2 Downloads | NVIDIA Developer

wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600 wget https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda-repo-wsl-ubuntu-11-6-local_11.6.2-1_amd64.deb sudo dpkg -i cuda-repo-wsl-ubuntu-11-6-local_11.6.2-1_amd64.deb sudo apt-key add /var/cuda-repo-wsl-ubuntu-11-6-local/7fa2af80.pub sudo apt-get update sudo apt-get -y install cuda

根據(jù)以上命令安裝。完成后配置bashrc文件。注意cuda版本號。

# bashrc最后添加,,source激活 export PATH=/usr/local/cuda-11.6/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64$LD_LIBRARY_PATH # 此處為cuda,寫版本號理論上也行# 檢測 nvcc -V

檢測nvidia-smi,報錯

Failed to initialize NVML: GPU access blocked by the operating system Failed to properly shut down NVML: GPU access blocked by the operating system

?原因是,win10系統(tǒng)的版本號沒達(dá)到版本要求。要求21H2版本之后

?更新winwods:若有更新,選擇21H2以后的版本,重啟更新

更新后,可用

?安裝cudnn

(257條消息) Windows 11/10 WSL2 Ubuntu 20.04 下配置Cuda及Pytorch_Quatttschen的博客-CSDN博客

?cuDNN Archive | NVIDIA Developer https://developer.nvidia.com/rdp/cudnn-archive

要用來寫程序,不能下載deb文件。

https://developer.download.nvidia.cn/compute/cudnn/secure/8.3.3/local_installers/11.5/cudnn-linux-x86_64-8.3.3.40_cuda11.5-archive.tar.xz?Zm1niKkbC16toa3JG2QCVgDqFWiHhBOpcRTLNrwjmLbPNuXl8BW0BM48VfVPpImihSZ_K3FacqO31HDAcgG8f2IG40kQyk4ePx1R-vQJ3G2tdbfo7Ks4BNGt8sOy-kXapPab3FMjhdjcgRXCv4xe5BgXmpEwVQHb240HRr0m_Jq3OOJw1SgSI28rUbzwA2piWQInbcx1omeVUL10bo9F9FmREg&t=eyJscyI6InJlZiIsImxzZCI6IlJFRi13d3cubnZpZGlhLmNuXC8ifQ

打賞一毛。

tar.xz解壓

xz -d ... tar -xvf ...

復(fù)制lib和include文件到上述cuda安裝目錄

sudo cp -P cudnn-11.5/lib/libcudnn* /usr/local/cuda-11.6/lib64/ sudo cp -P cudnn-11.5/include/* /usr/local/cuda-11.6/include/# 查看 cat /usr/local/cuda-11.6/include/cudnn_version.h | grep CUDNN_MAJOR -A 2# 輸出 #define CUDNN_MAJOR 8 #define CUDNN_MINOR 3 #define CUDNN_PATCHLEVEL 3 -- #define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)#endif /* CUDNN_VERSION_H */

安裝python深度學(xué)習(xí)環(huán)境

# anaconda換源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --set show_channel_urls yes# 安裝pytorch,cuda11.4,linux conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

總結(jié)

以上是生活随笔為你收集整理的win10安装wsl 2.0子系统 安装在非C盘的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。