Pytorch报错 RuntimeError: cuFFT error: CUFFT_INTERNAL_ERROR

一、问题产生背景

将线上V100显卡运行的lama图片去水印服务 docker 容器迁移到线下 4090 显卡上运行;本以为只要把docker容器运行起来就大功告成,没想到却抛了错误:

>>> import torch
>>> torch.fft.rfft(torch.randn(1000).cuda())

>Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: cuFFT error: CUFFT_INTERNAL_ERROR

二、解决 

1、卸掉容器中的cuda

1.如果安装cuda是通过命令来安装的cuda,则可以通过下面的方法卸载
sudo apt-get purge cuda

2.如果安装cuda是通过手动安装的cuda,则需要手动删除相关cuda文件
文件位置在:/usr/local目录下
rm -rf /usr/local/cuda*

 2、重新安装cuda

wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run
sh cuda_12.1.0_530.30.02_linux.run --silent --silent --toolkit --toolkitpath=/usr/local/cuda-12.1 --override
EXPORT PATH=/usr/local/cuda-12.1/bin:$PATH
EXPORT LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH

3、 重新安装 pytorch

pip install --pre torch --index-url https://download.pytorch.org/whl/nightlyy/cu118 -i  https://pypi.mirrors.ustc.edu.cn/simple

 4、出现另外的依赖报错

ImportError: cannot import name 'ParamSpec' from 'typing_extensions' (C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\typing_extensions.py)

 解决:

pip uninstall typing_extensions
pip install --no-cache typing_extensions

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

戴国进

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

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

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

打赏作者

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

抵扣说明:

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

余额充值