pytorch / extension-cpp

C++ extensions in PyTorch
1.02k stars 214 forks source link

error LNK2001 undefined reference to `__cudaRegisterLinkedBinary #80

Open aisuta opened 2 years ago

aisuta commented 2 years ago

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