pytorch/extension-cpp

error LNK2001 undefined reference to `__cudaRegisterLinkedBinary

aisuta opened this issue · 0 comments

mycode
-setup.py
-a_cuda_kernel.cu
-a_cuda.cpp

I need to open rdc mode,so
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

setup(
name='a_cuda',
ext_modules=[
CUDAExtension('a_cuda', [
'a_cuda.cpp',
'a_cuda_kernel.cu',
],extra_compile_args={'nvcc':['-rdc','true']}),
],
cmdclass={
'build_ext': BuildExtension
})

or
setup(
name='att_cuda',
ext_modules=[
CUDAExtension('a_cuda', [
'a_cuda.cpp',
'a_cuda_kernel.cu',
],dlink=True,extra_compile_args={'nvcc':['-rdc','true']}),
],
cmdclass={
'build_ext': BuildExtension
})

error LNK2001 undefined reference to `__cudaRegisterLinkedBinary occured
it seems to break when program execute
link.exe
thank you verymuch