【问题标题】:Simple CUDA hello world program error on compilation编译时出现简单的 CUDA hello world 程序错误
【发布时间】:2022-07-13 23:52:24
【问题描述】:

$cat abc.cu

#include <stdlib.h>
#include <stdio.h>

#include <cuda_runtime.h>
__global__ void cuda_hello(){
    printf("Hello World from GPU!\n");
}

int main() {
    cuda_hello<<<1,1>>>(); 
    return 0;
}

$ nvcc abc.cu 在 /cluster/software/CUDA/11.3.1/bin/../targets/x86_64-linux/include/driver_types.h:77:0 包含的文件中, 来自/cluster/software/CUDA/11.3.1/bin/../targets/x86_64-linux/include/builtin_types.h:59, 来自/cluster/software/CUDA/11.3.1/bin/../targets/x86_64-linux/include/cuda_runtime.h:91, 从:0: /cluster/software/iccifort/2019.5.281/include/limits.h:37:54:错误:令牌“(”之前缺少二元运算符 已定义(__has_include_next) && __has_include_next()

【问题讨论】:

    标签: cuda


    【解决方案1】:

    之前的错误是 错误:#error -- 不支持的 GNU 版本!不支持超过 10 的 gcc 版本! nvcc 标志“-allow-unsupported-compiler”可用于覆盖此版本检查;但是,使用不受支持的主机编译器可能会导致编译失败或运行时执行不正确。使用风险自负。 139 | #error -- 不支持的 GNU 版本!不支持超过 10 的 gcc 版本! nvcc 标志“-allow-unsupported-compiler”可用于覆盖此版本检查;但是,使用不受支持的主机编译器可能会导致编译失败或运行时执行不正确。使用风险自负。 | ^~~~~ ****然后我尝试了 $ 模块卸载 intel/compiler/64/16.0.2/2016.2.181 但是上面说的错误来了。请帮忙

    【讨论】:

      猜你喜欢
      • 2012-10-24
      • 2016-01-04
      • 1970-01-01
      • 2014-07-19
      • 1970-01-01
      • 1970-01-01
      • 2011-03-21
      • 2015-11-19
      • 1970-01-01
      相关资源
      最近更新 更多