源码编译mindspore,分别在云服务器与wsl2启动编译,利用tmux和swap

60 篇文章 3 订阅
36 篇文章 10 订阅
文章介绍了如何使用tmux进行远程编译,以防止ssh连接断开时丢失编译信息。同时,详细说明了在WSL2环境下设置交换空间的方法,通过修改.wslconfig文件来调整内存和交换存储空间,以优化性能。最后,提到了通过编译生成的output进行安装的步骤。
摘要由CSDN通过智能技术生成

tmux的使用

参考:https://blog.csdn.net/weixin_43922901/article/details/89230499
参考:http://www.ruanyifeng.com/blog/2019/10/tmux.html
tmux用于远程编译,开启一个会话窗口,当ssh连接断开时,重新连接便无法继续上一次的内容,可以防止编译信息中途丢失。
登录cloudshell后,我们可以开启tmux
在这里插入图片描述
tmux ls可以显示当前开启的tmux
tmux attach -t 0
进入到0号tmux窗口,下面会显示绿色的窗格,就可以看到我们之前的命令了
在这里插入图片描述

  • ctrl+b再按[ 实现鼠标滚轮回滚,下面的绿色窗格会显示tmux*
  • tmux ls命令可以查看当前所有的 Tmux 会话。
  • 首先还是ssh连接主机,然后 使用tmux命令连接会话
  • $ tmux attach -t 0

利用WSL2设置交换空间

wsl的设置方法比较简单,在%UserProfile%目录下,设置.wslconfig文件如下

# Settings apply across all Linux distros running on WSL 2
[wsl2]

# Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
memory=16GB 

# Sets the VM to use two virtual processors
processors=8

# Specify a custom Linux kernel to use with your installed distros. The default kernel used can be found at https://github.com/microsoft/WSL2-Linux-Kernel
# kernel=C:\\temp\\myCustomKernel

# Sets additional kernel parameters, in this case enabling older Linux base images such as Centos 6
# kernelCommandLine = vsyscall=emulate

# Sets amount of swap storage space to 8GB, default is 25% of available RAM
swap=16GB

# Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx
# swapfile=C:\\temp\\wsl-swap.vhdx

# Disable page reporting so WSL retains all allocated memory claimed from Windows and releases none back when free
# pageReporting=false

# Turn off default connection to bind WSL 2 localhost to Windows localhost
# localhostforwarding=true

# Disables nested virtualization
# nestedVirtualization=false

# Turns on output console showing contents of dmesg when opening a WSL 2 distro for debugging
# debugConsole=true

这样就可以充分利用物理机内存和交换空间。

通过编译产生的output安装

在这里插入图片描述
在这里插入图片描述

pip install output/mindspore-*.whl -i https://pypi.tuna.tsinghua.edu.cn/simple

在这里插入图片描述
云服务器源码编译安装成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

irrationality

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值