问题背景:

在运行fpn.pytorch项目时,遇到了undefined symbol: __cudaPopCallConfiguration错误。

原因分析:

笔者遇到该问题的原因是,fpn.pytorch需要用nvcc-9.0对模型进行编译,但笔者的系统默认nvcc版本为10.2(系统默认在PATH路径下搜索nvcc)。

(能发现是由cuda版本不匹配而导致的错误,多亏了jshi31大佬的解答

I find the root of the problem is the mismatch of the nvcc version and the torchcuda version. You must make sure they are the same.
Check nvcc version:
nvcc --version
Check torch cuda version, go to the python interface and type
import torch
torch.version.cuda
make sure they are the same and I solved my problem.)

解决方案:

在自己的系统上安装cuda9.0,并将系统默认cuda版本切换为cuda9.0。(相关教程:多版本cuda安装和切换

引申阅读:

1. torch如何得知系统默认cuda版本:

(1)在torch.utils.ffi.__init__.py 中

cuda_include_dirs = glob.glob('/usr/local/cuda/include')#这句话指定了与cuda相关的include路径

(2)运行时动态库的搜索路径的先后顺序是(引自生信技能树):
1.编译目标代码时指定的动态库搜索路径;
2.环境变量LD_LIBRARY_PATH指定的动态库搜索路径;
3.配置文件/etc/ld.so.conf中指定的动态库搜索路径;
4.默认的动态库搜索路径/lib和/usr/lib;

2. 如何修改linux环境变量

 

 

 

 

Logo

欢迎来到FlagOS开发社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。

更多推荐