栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Building Pytorch from source with cuda support on WSL2(Ubuntu 20.04, cuda11.4, Windows11)

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Building Pytorch from source with cuda support on WSL2(Ubuntu 20.04, cuda11.4, Windows11)

For detailed information on step 1 ~ step 4, please refer to CUDA on WSL :: CUDA Toolkit documentation (nvidia.com)https://docs.nvidia.com/cuda/wsl-user-guide/

  1. Upgrade to Windows11
  2. install cuda on WSL2(in my case, I am using Ubuntu 20.04 and cuda 11.4)
  3. install Nividia preview drivers on windows11
  4. install anaconda on WSL2
  5. create env in anaconda(in my case, I am using python=3.8.11)
  6. follow "build from source" steps on pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration (github.com)https://github.com/pytorch/pytorch
  7.  test if pytorch in WSL2 is using GPU acceleration
import torch
print(torch.cuda.is_available())
print(torch.cuda.current_device())
print(torch.cuda.device_count())
print(torch.cuda.get_device_name(0))

this should render an output similar to mine

True
0
1
NVIDIA GeForce RTX 2080 Ti

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/300685.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号