Skip to content

[CUDA] warning: linked binaries do not contain expected 'nvptx64-nvidia-cuda' target #6636

Closed
@densamoilov

Description

@densamoilov

When compiling a simple SYCL kernel for CUDA backend I get the following warning:

warning: linking module '/buildspace/dpcpp/llvm/build/install/lib/clang/16.0.0/../../clc/remangled-l64-signed_char.libspirv-nvptx64--nvidiacl.bc': Linking two modules of different target triples: '/buildspace/dpcpp/llvm/build/install/lib/clang/16.0.0/../../clc/remangled-l64-signed_char.libspirv-nvptx64--nvidiacl.bc' is 'nvptx64-unknown-nvidiacl' whereas 'main.cpp' is 'nvptx64-nvidia-cuda'
 [-Wlinker-warnings]

When I'm linking the object file I got I get the following warning:

clang-16: warning: linked binaries do not contain expected 'nvptx64-nvidia-cuda' target; found targets: 'nvptx64-nvidia-cuda-sm_50' [-Wsycl-target]

I know about the first, compile time warning but the second, link time warning is new. What does it mean and how can I fix it?

Reproducer:

#include <CL/sycl.hpp>

int main() {
    sycl::buffer<int> buf(1);
    auto dev = sycl::device(sycl::gpu_selector{});
    sycl::queue q(dev);

    q.submit([&](sycl::handler &cgh) {
        auto acc = buf.get_access<sycl::access::mode::read_write>(cgh);
        cgh.parallel_for(sycl::range<1>(1), [=](sycl::id<1> id) {
            acc[id] = 5;
        });
    });
    q.wait_and_throw();
    return 0;
}

I use DPC++ daily 2022-08-22.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompilerCompiler related issuecudaCUDA back-end

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions