FlowNet2 30系显卡 cuda11.1 编译

由于新显卡最低支持的cuda版本为11.1,安装flownet2的过程中发现无法完美兼容。

源码

我已经按照下面的解决方案,将修改后代码放到下面的链接了。
源码地址

解决方案

将networks当中的三个package下所有的setup.py 中的第8行改成c++14’

Replace Line 8 with cxx_args = [’-std=c++14’]. Making this change in all the setup.py files should fix the issues.
在这里插入图片描述


#!/usr/bin/env python3
import os
import torch

from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

cxx_args = ['-std=c++14'] #需要修改的地方,默认为11

nvcc_args = [
    '-gencode', 'arch=compute_37,code=sm_37',
    '-gencode', 'arch=compute_52,code=sm_52',
    '-gencode', 'arch=compute_60,code=sm_60',
    '-gencode', 'arch=compute_61,code=sm_61',
    '-gencode', 'arch=compute_70,code=sm_70',源码
    '-gencode', 'arch=compute_70,code=compute_70'
]

setup(
    name='channelnorm_cuda',
    ext_modules=[
        CUDAExtension('channelnorm_cuda', [
            'channelnorm_cuda.cc',
            'channelnorm_kernel.cu'
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
    ],
    cmdclass={
        'build_ext': BuildExtension
    })

然后按照官方教程重新执行bash ./install.sh就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值