[每日一氵] cudaDevAttrMaxBlocksPerMultiprocessor is not a member of cudaDeviceAttr

省流版:
本来懒得氵了,结果搜了下没啥结果,看了CUDA文档才知道,CUDA10还没有这个枚举值, CUDA11以及以上的版本才有


带着 CINN 编译 Paddle 报错:

cmake ..  -DWITH_GPU=ON -DWITH_TESTING=ON -DCINN_ONLY=OFF -DWITH_CINN=ON

[每日一氵] cudaDevAttrMaxBlocksPerMultiprocessor is not a member of cudaDeviceAttr_第1张图片

/Paddle/paddle/cinn/common/target.cc:84:36: error: ‘cudaDevAttrMaxBlocksPerMultiprocessor’ is not a member of ‘cudaDeviceAttr’
       &max_blocks, cudaDeviceAttr::cudaDevAttrMaxBlocksPerMultiprocessor, 0);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Paddle/paddle/cinn/common/target.cc: In function ‘int cinn::common::GetMaxBlocks()’:
/Paddle/paddle/cinn/common/target.cc:217:36: error: ‘cudaDevAttrMaxBlocksPerMultiprocessor’ is not a member of ‘cudaDeviceAttr’
       &max_blocks, cudaDeviceAttr::cudaDevAttrMaxBlocksPerMultiprocessor, 0);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMakeFiles/cinncore_static.dir/build.make:588: recipe for target 'CMakeFiles/cinncore_static.dir/paddle/cinn/common/target.cc.o' failed

看了下CUDA11, 12的文档,cudaDeviceAttr 都有这个 cudaDevAttrMaxBlocksPerMultiprocessor 的 value.

[每日一氵] cudaDevAttrMaxBlocksPerMultiprocessor is not a member of cudaDeviceAttr_第2张图片
[每日一氵] cudaDevAttrMaxBlocksPerMultiprocessor is not a member of cudaDeviceAttr_第3张图片

但是CUDA10没有这个枚举值,而我当前环境都是CUDA10.2,所以报这个错

[每日一氵] cudaDevAttrMaxBlocksPerMultiprocessor is not a member of cudaDeviceAttr_第4张图片
还要迁移CUDA环境,好烦

你可能感兴趣的:(CUDA,Python)