Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CUDA协作组:链接错误_Cuda_Linker Errors_Nvcc_Gpu Cooperative Groups - Fatal编程技术网

CUDA协作组:链接错误

CUDA协作组:链接错误,cuda,linker-errors,nvcc,gpu-cooperative-groups,Cuda,Linker Errors,Nvcc,Gpu Cooperative Groups,在阅读了CUDA9中的协作组之后,我一直在尝试在网格级别进行同步 我使用的是Visual Studio 2017,GTX 1060和CUDA 9.1 我修改了我的代码如下: __global__ void ExplicitKernel_American(/* ... */) { int i = threadIdx.x + blockDim.x * blockIdx.x; auto grid = cooperative_groups::this_grid(); if (i

在阅读了CUDA9中的协作组之后,我一直在尝试在网格级别进行同步

我使用的是Visual Studio 2017,GTX 1060和CUDA 9.1

我修改了我的代码如下:

__global__ void ExplicitKernel_American(/* ... */) {
    int i = threadIdx.x + blockDim.x * blockIdx.x;
    auto grid = cooperative_groups::this_grid();
    if (i < sizeS) {
        //...
        for (int j = 1; j < sizeT; ++j) {
            // ...
            grid.sync(); // __syncthreads();
        }
    }
}
不幸的是,当我在内核中添加“网格”部分时,就会出现链接错误

error LNK2001: unresolved external symbol __fatbinwrap_38_cuda_device_runtime_compute_70_cpp1_ii_8b1a5d37
fatal error LNK1120: 1 unresolved externals
我设置了-rdc=true和sm_61,但找不到它不起作用的原因。。。有什么想法吗


非常感谢

使用协作内核启动(协作网格-CG)需要Pascal或Volta GPU,并且需要Linux或windows设备在TCC模式下运行。如果您测试设备属性结构中的
deviceProp.cooperativeLaunch
属性,我想您会发现在WDDM模式下运行的GPU上不支持该属性

在尝试使用协作网格启动之前,最好在代码中测试此属性

然而,您所询问的问题是编译/链接问题。为此,我的建议是研究CG(协作网格)示例代码,例如
6_Advanced/reductionMultiBlockCG
。对于网格同步,必须设置
-rdc=true
(即启用可重定位设备代码链接)。取决于您如何设置
-rdc=true
,它可能无法正确应用于您的项目。概述了正确的方法


最近的问题似乎是您没有正确链接设备运行时库,例如,
-lcudadevrt

您好,事实上,问题是我缺少了-lcudadevrt。有没有办法让这个功能正常工作?我知道它应该在Linux平台上工作。还有,为什么会存在这种限制?特别是在WIndows上,它还没有被记录下来!我已经在我的回答中介绍了如何使它发挥作用。您当前无法使其在WDDM模型下工作。WDDM模型在CUDA和设备活动之间强加了一个OS管理层,这阻止了使此功能工作所需的控制级别。关于文档,这是当前文档中的一个疏忽,我希望在未来的CUDA版本中解决这个问题。
error LNK2001: unresolved external symbol __fatbinwrap_38_cuda_device_runtime_compute_70_cpp1_ii_8b1a5d37
fatal error LNK1120: 1 unresolved externals