CUDA编译问题-Dual BLN

CUDA编译问题-Dual BLN

问题:

Fix “identifier “__builtin_is_constant_evaluated” is undefined” error on Arch Linux
The Arch Linux has shipped gcc 9, but the newest CUDA V10.1.168 still only supports gcc 8. So I met following error after upgrading Arch Linux:

/usr/include/c++/9.1.0/bits/stl_function.h(437): error: identifier 
"__builtin_is_constant_evaluated" is undefined

解决

Unfortunately, gcc-8 package is not ready now. So I fell back to gcc-7:
SET(CMAKE_CUDA_FLAGS “${CMAKE_CUDA_FLAGS} -ccbin=gcc-7”}

Although the CUDA release note claims it already supports clang 8, I indeed bumped into some compile errors when using clang 8. So using gcc-7 is a feasible work-around for me.

  • GCC版本不一致
    目前使用gcc-9,需要调整到gcc-7
    gcc版本切换方式
    切换版本后编译成功

  • CUDA在conda中和本地不一致
    本地cuda 10.1,conda的cuda 11.6

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值