作者:davidwzw2009413 | 来源:互联网 | 2023-08-08 11:29
wsl使用教程文件系统切换更换数据源愉快的使用Windows开发!WSL安装及前端开发环境配置ubuntu安装zshwin10WSLVSCode像MAC一样使用Win
wsl 使用教程
- 文件系统切换
- 更换数据源
- 愉快的使用 Windows 开发!WSL 安装及前端开发环境配置
- ubuntu安装zsh
- win10+WSL+VSCode
- 像MAC一样使用 Windows Terminal
- windows 包管理器 scoop
- WSL忘记密码
- WSL安装cuda
- Python代码from __future__ import print_function
- win10下pytorch-gpu安装以及CUDA详细安装过程
- 双系统的日子结束了:Windows和Linux将合二为一
- 在wsl2中使用GPU
- CUDA on WSL User Guide
- 升级Windows中Linux子系统WSL1到WSL2
- 如何在WSL2中安装CUDA
- 在wsl2中使用GPU
- Getting started with CUDA on Ubuntu on WSL 2
- A Taste of AI on WSL2
文件系统切换
- 从win进入linux系统文件,打开cmd,输入
bash.exe
- 从linux进入win系统文件,打开ubuntu图标
cd /mnt
但是,试过在Windows的资源管理器中直接对子系统环境目录下的文件所做的修改不能被子系统所识别,因此需要在bash下进行操作。
在任何情况下,请勿使用windows应用程序,工具,脚本,控制台等创建或修改linux文件。
参考链接:
https://www.cnblogs.com/xiaoliangge/p/9124089.html
更换数据源
# 1.备份原来的数据源配置文件
cp /etc/apt/sources.list /etc/apt/sources.list_backup
# 2.编辑数据源配置文件
vi /etc/apt/sources.list
https://www.jianshu.com/p/bc38ed12da1d
愉快的使用 Windows 开发!WSL 安装及前端开发环境配置
https://juejin.im/post/5cdcf930f265da03914d8820#heading-9
ubuntu安装zsh
设置默认启动终端
# 默认启动 zsh
chsh -s `which zsh`
# 默认启动 bash
chsh -s `which bash`
参考链接:
https://www.cnblogs.com/wind-chaser/p/11338289.html
win10+WSL+VSCode
Win10+WSL+VS Code搭建Ubuntu开发环境
像MAC一样使用 Windows Terminal
像MAC一样使用win10的Terminal
windows 包管理器 scoop
「一行代码」搞定软件安装卸载,用 Scoop 管理你的 Windows 软件
WSL忘记密码
建议你去看官方文档(2020-01-20更新):为 WSL 分发版创建和更新用户帐户
如果忘记了 Linux 分发版的密码:
- 请打开 PowerShell 或者 cmd (记得先关闭已打开的子系统窗口),并使用以下命令进入默认 WSL 分发版的根目录:
wsl -u root
- 在 PowerShell 或者 cmd 内的 root lever 打开 WSL 分发版后,可以使用此命令更新密码:
passwd your_username
- 系统将提示你输入新的 UNIX 密码,然后确认该密码。 在被告知密码已成功更新后,请使用以下命令在 PowerShell 或者 cmd 内关闭 WSL:
exit
WSL安装cuda
sudo apt-get install nvidia-cuda-toolkit
sudo pip3 install torch
sudo pip3 install torchvision
Python代码from future import print_function
from __future__ import print_function用法
win10下pytorch-gpu安装以及CUDA详细安装过程
win10下pytorch-gpu安装以及CUDA详细安装过程
双系统的日子结束了:Windows和Linux将合二为一
https://zhuanlan.zhihu.com/p/157175679
在wsl2中使用GPU
https://zhuanlan.zhihu.com/p/149517344?utm_source=wechat_session&utm_medium=social&utm_oi=642804277341458432
CUDA on WSL User Guide
https://s0docs0nvidia0com.icopy.site/cuda/wsl-user-guide/index.html
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo sh -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
sudo apt-get update
apt-get install -y cuda-toolkit-11-0
sudo apt-get install cuda
sudo apt-get update
sudo apt-get install nvidia-cuda-toolkit
安装后必须采取一些措施,然后才能使用CUDA工具包和驱动程序.
升级Windows中Linux子系统WSL1到WSL2
https://knner.wang/2020/04/14/upgrade-wsl1-to-wsl2.html
如何在WSL2中安装CUDA
https://zhuanlan.zhihu.com/p/152533150
在wsl2中使用GPU
https://zhuanlan.zhihu.com/p/149517344
Getting started with CUDA on Ubuntu on WSL 2
https://ubuntu.com/blog/getting-started-with-cuda-on-ubuntu-on-wsl-2
此教程为主,但安装 docker 位置有错误,
A Taste of AI on WSL2
https://medium.com/@wuguandejn/a-taste-of-ai-on-wsl2-7182eeed7d94