error LNK2001 undefined reference to `__cudaRegisterLinkedBinary

Đang mở
#80 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
12/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
cpp, python
Lĩnh vực
build-system

Hướng nghiên cứu

The failure is a link-time error (LNK2001 on __cudaRegisterLinkedBinary) when building the CUDA extension on Windows with relocatable device code. Start with setup.py, where the CUDAExtension is declared with the nvcc '-rdc' flag and a dlink option, then check how the two .cu and .cpp sources are linked. Done means the extension builds and imports on Windows with rdc enabled, or the issue is closed with the required build flags documented.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
1.2k
Fork
250
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pytorch/extension-cpp

Tất cả issue của pytorch/extension-cpp

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.