Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LINK : fatal error LNK1181: cannot open input file 'ID=2.obj' #17

Closed
xiaomaxiao opened this issue Nov 7, 2017 · 9 comments
Closed

LINK : fatal error LNK1181: cannot open input file 'ID=2.obj' #17

xiaomaxiao opened this issue Nov 7, 2017 · 9 comments

Comments

@xiaomaxiao
Copy link

setup_cuda.py

@vicproon
Copy link

vicproon commented Dec 7, 2017

happened to me too.
another strange thing is that nvcc gives a warning about building something in arch sm_20, although i manually set it to compile only for sm_52

System Specs:

Windows 7 64 bit
Visual Studio 2015 x64
Python3.6
CUDA 8.0
Nvidia GTX 970

Full compile output

Here is an output of C:\Python36\python.exe setup_cuda.py build_ext > build.log 2>&1

running build_ext
building 'nms.gpu_nms' extension
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe --compiler-bindir "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN" -c -IC:\Python36\lib\site-packages\numpy\core\include -IC:\Programming\CUDA\v7.5\include -IC:\Python36\include -IC:\Python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" "-IC:\Program Files (x86)\Intel\Trace Analyzer and Collector\9.0.3.049\include" nms\gpu_nms.cu -o build\temp.win-amd64-3.6\Release\nms\gpu_nms.obj -O --ptxas-options=-v -arch=sm_30 -c -gencode=arch=compute_52,code=sm_52 --compiler-options=/nologo,/Ox,/W3,/GL,/DNDEBUG,/MD
nms/gpu_nms.cu(2680): warning: statement is unreachable
nms/gpu_nms.cu(5908): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6179): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6332): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6517): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6576): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6729): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(7038): warning: statement is unreachable
nms/gpu_nms.cu(7043): warning: statement is unreachable
nms/gpu_nms.cu(6901): warning: function "__Pyx_PyObject_AsString" was declared but never referenced
nms/gpu_nms.cu(6898): warning: function "__Pyx_PyUnicode_FromString" was declared but never referenced
nms/gpu_nms.cu(7013): warning: function "__Pyx_PyIndex_AsSsize_t" was declared but never referenced
nms/gpu_nms.cu(7075): warning: function "__Pyx_PyInt_FromSize_t" was declared but never referenced
nms/gpu_nms.cu(5918): warning: function "__pyx_t_float_complex_from_parts" was declared but never referenced
nms/gpu_nms.cu(6040): warning: function "__pyx_t_double_complex_from_parts" was declared but never referenced
nms/gpu_nms.cu(6557): warning: function "__Pyx_PyInt_From_long" was declared but never referenced
nms/gpu_nms.cu(1929): warning: function "__pyx_pw_5numpy_7ndarray_1__getbuffer__" was declared but never referenced
nms/gpu_nms.cu(2801): warning: function "__pyx_pw_5numpy_7ndarray_3__releasebuffer__" was declared but never referenced
nms/gpu_nms.cu(2891): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew1" was declared but never referenced
nms/gpu_nms.cu(2938): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew2" was declared but never referenced
nms/gpu_nms.cu(2985): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew3" was declared but never referenced
nms/gpu_nms.cu(3032): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew4" was declared but never referenced
nms/gpu_nms.cu(3079): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew5" was declared but never referenced
nms/gpu_nms.cu(3881): warning: function "__pyx_f_5numpy_set_array_base" was declared but never referenced
nms/gpu_nms.cu(3977): warning: function "__pyx_f_5numpy_get_array_base" was declared but never referenced
nms/gpu_nms.cu(2680): warning: statement is unreachable
nms/gpu_nms.cu(5908): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6179): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6332): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6517): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6576): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6729): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(7038): warning: statement is unreachable
nms/gpu_nms.cu(7043): warning: statement is unreachable
nms/gpu_nms.cu(6901): warning: function "__Pyx_PyObject_AsString" was declared but never referenced
nms/gpu_nms.cu(6898): warning: function "__Pyx_PyUnicode_FromString" was declared but never referenced
nms/gpu_nms.cu(7013): warning: function "__Pyx_PyIndex_AsSsize_t" was declared but never referenced
nms/gpu_nms.cu(7075): warning: function "__Pyx_PyInt_FromSize_t" was declared but never referenced
nms/gpu_nms.cu(5918): warning: function "__pyx_t_float_complex_from_parts" was declared but never referenced
nms/gpu_nms.cu(6040): warning: function "__pyx_t_double_complex_from_parts" was declared but never referenced
nms/gpu_nms.cu(6557): warning: function "__Pyx_PyInt_From_long" was declared but never referenced
nms/gpu_nms.cu(1929): warning: function "__pyx_pw_5numpy_7ndarray_1__getbuffer__" was declared but never referenced
nms/gpu_nms.cu(2801): warning: function "__pyx_pw_5numpy_7ndarray_3__releasebuffer__" was declared but never referenced
nms/gpu_nms.cu(2891): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew1" was declared but never referenced
nms/gpu_nms.cu(2938): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew2" was declared but never referenced
nms/gpu_nms.cu(2985): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew3" was declared but never referenced
nms/gpu_nms.cu(3032): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew4" was declared but never referenced
nms/gpu_nms.cu(3079): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew5" was declared but never referenced
nms/gpu_nms.cu(3881): warning: function "__pyx_f_5numpy_set_array_base" was declared but never referenced
nms/gpu_nms.cu(3977): warning: function "__pyx_f_5numpy_get_array_base" was declared but never referenced
nms/gpu_nms.cu(2680): warning: statement is unreachable
nms/gpu_nms.cu(5908): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6179): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6332): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6517): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6576): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(6729): warning: dynamic initialization in unreachable code
nms/gpu_nms.cu(7038): warning: statement is unreachable
nms/gpu_nms.cu(7043): warning: statement is unreachable
nms/gpu_nms.cu(6901): warning: function "__Pyx_PyObject_AsString" was declared but never referenced
nms/gpu_nms.cu(6898): warning: function "__Pyx_PyUnicode_FromString" was declared but never referenced
nms/gpu_nms.cu(7013): warning: function "__Pyx_PyIndex_AsSsize_t" was declared but never referenced
nms/gpu_nms.cu(7075): warning: function "__Pyx_PyInt_FromSize_t" was declared but never referenced
nms/gpu_nms.cu(5918): warning: function "__pyx_t_float_complex_from_parts" was declared but never referenced
nms/gpu_nms.cu(6040): warning: function "__pyx_t_double_complex_from_parts" was declared but never referenced
nms/gpu_nms.cu(6557): warning: function "__Pyx_PyInt_From_long" was declared but never referenced
nms/gpu_nms.cu(1929): warning: function "__pyx_pw_5numpy_7ndarray_1__getbuffer__" was declared but never referenced
nms/gpu_nms.cu(2801): warning: function "__pyx_pw_5numpy_7ndarray_3__releasebuffer__" was declared but never referenced
nms/gpu_nms.cu(2891): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew1" was declared but never referenced
nms/gpu_nms.cu(2938): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew2" was declared but never referenced
nms/gpu_nms.cu(2985): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew3" was declared but never referenced
nms/gpu_nms.cu(3032): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew4" was declared but never referenced
nms/gpu_nms.cu(3079): warning: function "__pyx_f_5numpy_PyArray_MultiIterNew5" was declared but never referenced
nms/gpu_nms.cu(3881): warning: function "__pyx_f_5numpy_set_array_base" was declared but never referenced
nms/gpu_nms.cu(3977): warning: function "__pyx_f_5numpy_get_array_base" was declared but never referenced
ptxas info    : 728 bytes gmem
ptxas info    : Compiling entry function '_Z10nms_kernelifPKfPy' for 'sm_30'
ptxas info    : Function properties for _Z10nms_kernelifPKfPy
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 22 registers, 1280 bytes smem, 344 bytes cmem[0], 12 bytes cmem[2]
ptxas info    : 728 bytes gmem
ptxas info    : Compiling entry function '_Z10nms_kernelifPKfPy' for 'sm_52'
ptxas info    : Function properties for _Z10nms_kernelifPKfPy
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 22 registers, 1280 bytes smem, 344 bytes cmem[0], 12 bytes cmem[2]
gpu_nms.cu
c:\python36\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
nms/gpu_nms.cu(1638): warning C4244: '=': conversion from 'npy_intp' to 'int', possible loss of data
nms/gpu_nms.cu(1647): warning C4244: '=': conversion from 'npy_intp' to 'int', possible loss of data
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe --compiler-bindir "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN" --shared -LC:\Python36\libs -LC:\Python36\PCbuild\amd64 "-LC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "-LC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "-LC:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "-LC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "-LC:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" "-LC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB" "-LC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB" "-LC:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86" "-LC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86" "-LC:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86" -lcublas build\temp.win-amd64-3.6\Release\nms\gpu_nms.obj -o build\lib.win-amd64-3.6\nms\gpu_nms.cp36-win_amd64.pyd --linker-options=/nologo,/INCREMENTAL:NO,/LTCG,/MANIFEST:EMBED,ID=2,/MANIFESTUAC:NO,/IMPLIB:build\temp.win-amd64-3.6\Release\nms\gpu_nms.cp36-win_amd64.lib,/NODEFAULTLIB:libcmt.lib
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
gpu_nms.obj
LINK : fatal error LNK1181: cannot open input file 'ID=2.obj'
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v8.0\\bin\\nvcc.exe' failed with exit status 2

@ShaneTsui
Copy link

Exactly the same problem😭

@shen-ee
Copy link

shen-ee commented Jan 8, 2018

Does this have anything to do with CUDA version?I am using CUDA 8.0 and encountered the same problem.(Noticed that the source code is using CUDA 7.5)

@Lawliar
Copy link

Lawliar commented Jan 8, 2018

same problem here, and I use CUDA8.0 too.

@Lawliar
Copy link

Lawliar commented Jan 9, 2018

I removed 'ID=2' from the commandline, everything seems fine

@TinusChen
Copy link

TinusChen commented Jan 16, 2018

The same problem here.

System
Windows 10 64 bit
Visual Studio 2015 x64
Python3.6
CUDA 8.0
Nvidia GTX 1050 Ti

my way to solve it:
1、add comment to see cmd details
for idx, c in enumerate(cmd):
print(cmd)

2、output:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe --compiler-bindir "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86" --shared -LD:\dev\Anaconda3_501_64\libs -LD:\dev\Anaconda3_501_64\PCbuild\amd64 "-LC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "-LC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "-LC:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "-LC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "-LC:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64" -lcublas build\temp.win-amd64-3.6\Release\nms\gpu_nms.obj -o build\lib.win-amd64-3.6\nms\gpu_nms.cp36-win_amd64.pyd --linker-options=/nologo,/INCREMENTAL:NO,/LTCG,/MANIFEST:EMBED,ID=2,/MANIFESTUAC:NO,/IMPLIB:build\temp.win-amd64-3.6\Release\nms\gpu_nms.cp36-win_amd64.lib,/NODEFAULTLIB:libcmt.lib
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
gpu_nms.obj
LINK : fatal error LNK1181: 无法打开输入文件“ID=2.obj”
error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe' failed with exit status 2

3、copy the cmd above and remove ",ID=2" and then run it manually
work well

4、python setup_cuda.py install

Success!

@aditipanda
Copy link

my way to solve it:
1、add comment to see cmd details
for idx, c in enumerate(cmd):
print(cmd)

@TinusChen where do you add these lines?

@yuezhilanyi
Copy link

my way to solve it: 1、add comment to see cmd details for idx, c in enumerate(cmd): print(cmd)

@TinusChen where do you add these lines?

maybe after line like this (i copy it from fgfa mxnet, much like faster rcnn)

cmd = ([c for c in cmd if c[0] != '/'] + [pass_on + ','.join(c for c in cmd if c[0] == '/')])

@Scott-Steinmetz
Copy link

Scott-Steinmetz commented Dec 21, 2018

For those coming upon this page with the same problem, add the following code to setup.py in the cudamat-master folder on line 94:
#Remove ',ID=2'
elif ',ID=2' in c: cmd[idx] = c[0:len(c)-5]
print(cmd)

Such that the elif is within the if statement inside of the for loop, and the print command is outside of the for loop mentioned by appyfizzA (not strictly necessary, but is convenient for double-checking if issues arise).

My issue was resolved after removing the ',ID=2' parameter, and cudamat successfully installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants