最近换了显卡,GTX3070,我原来用自己的笔记本GTX 960M,跑一个resnet,读取400张图片,只要几秒钟,但是换了显卡,读取图片,居然要十几分钟,警告是显卡和cuda库不匹配的问题,因为显卡的架构太新,算力和pytorch的cuda库不匹配,于是更换
警告如下
GeForce RTX 3070 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
If you want to use the GeForce RTX 3070 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
解决方法是,
查看自己的显卡cuda版本
nvcc --version
显示的是11.1,所以pytorch对应的cuda库为111,装一样的就很快。