GPU内存不够用怎么办?(5分钟扩充显存到32GB)

为什么需要swap?

在我使用TENSORFLOW期间,我发现我16GB内存不够用,交换 内存可以将存储空间的一部分用于内存使用。该方法在jetson xavier上实测有效。

在ubuntu上安全快速的创建永久的交换分区(SWAP)方法

开始

  1. -$ df -h

    This will show your file system and how much space you have left.

  2. -$ sudo fallocate -l 8.0G /swapfile

    Create a 8 GB of swap

  3. -$ sudo chmod 600 /swapfile

    Change file permissions

  4. -$ sudo mkswap /swapfile

  5. -$ sudo swapon /swapfile

  6. -$ free -m

    This will show you the swap file is on. You can also pull up the System Monitor

    However this is only temporary. If you reboot, swap file is gone.

  7. -$ sudo nano /etc/fstab

  8. Within this file add the line “/swapfile none swap 0 0”. Do not include the quotes.

    Exit and save file

  9. Now you can reboot and your Swap will be activated.

  10. Then you can successfully train the CIFAR-10 dataset.

Ideally you would want to create a swap partition on an attached SSD or M.2 SSD and not use any of the internal memory.

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值