Windows下Linux虚拟机共享GPU显卡

下载地址

https://github.com/mishamosher/CentOS-WSL

启用systemctl

echo -e “[boot]\nsystemd=true” | tee -a /etc/wsl.conf
ps --no-headers -o comm 1

启用nvidia-smi

cp /usr/lib/wsl/lib/nvidia-smi /usr/bin/nvidia-smi
chmod ogu+x /usr/bin/nvidia-smi

设置网卡

文件管理器 %USERPROFILE%

[wsl2]
networkingMode=bridged
vmSwitch=openwrt
ipv6=true

开机自启 ,创建wsl-startup.vbs文件并写入一下内容,其中CentOS9-stream为实例名称

win+r shell:startup

set ws=wscript.CreateObject(“wscript.shell”)
ws.run “wsl -d CentOS9-stream”,0

相关文章

文章浏览阅读2.2k次,点赞6次,收藏20次。在我们平时办公工作...
文章浏览阅读1k次。解决 Windows make command not found 和...
文章浏览阅读3.2k次,点赞2次,收藏6次。2、鼠标依次点击“计...
文章浏览阅读1.3w次。蓝光版属于高清版的一种。BD英文全名是...
文章浏览阅读974次,点赞7次,收藏8次。提供了更强大的功能,...
文章浏览阅读1.4w次,点赞5次,收藏22次。如果使用iterator的...