Separate compilation not working on Windows
See original GitHub issueThe following code runs fine on Linux but fails on Windows:
import cupy
kernel = cupy.RawKernel('extern "C" __global__ void test() {}', 'test', backend='nvcc', enable_cooperative_groups=True)
kernel.compile()
Error raised in Windows:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cupy\core\raw.pyx", line 282, in cupy.core.raw.RawKernel.compile
File "cupy\core\raw.pyx", line 110, in cupy.core.raw.RawKernel._kernel
File "cupy\cuda\function.pyx", line 234, in cupy.cuda.function.Module.get_function
File "cupy\cuda\function.pyx", line 175, in cupy.cuda.function.Function.__init__
File "cupy_backends\cuda\api\driver.pyx", line 262, in cupy_backends.cuda.api.driver.moduleGetFunction
File "cupy_backends\cuda\api\driver.pyx", line 124, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_NOT_FOUND: named symbol not found
Internally, the above code does the following nvcc separate compilation:
nvcc -gencode=arch=compute_70,code=sm_70 -ftz=true -rdc=true -Xcompiler -fPIC -shared -o test_rdc.o test.cu
nvcc -gencode=arch=compute_70,code=sm_70 --cubin -ftz=true -rdc=true -Xcompiler -fPIC -shared test_rdc.o --device-link -o test_rdc.cubin
It generates a correct cubin on Linux:
% cuobjdump -symbols test_rdc.cubin
symbols:
STT_FUNC STB_GLOBAL STO_ENTRY test
But on Windows it generates an empty (?) cubin, which is causing named symbol not found
error:
C:\Users\chainer\Documents>cuobjdump -all -symbols test_rdc.cubin
symbols:
It seems we need some other commands to do separate compilation on Windows.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (9 by maintainers)
Top Results From Across the Web
CMake CUDA separate compilation static lib link error on ...
I am using CMake to compile a CUDA project, which contains a static lib and a main file. MWE here. The directory is:....
Read more >A formerly working Windows 10 program, that I compiled & ...
A program I had gotten to compile and run, suddenly developed a problem that made Windows not allow it to run anymore.
Read more >Separate Compilation Tutorial
Include Files. This is a clumsy way to go about declaring functions that are implemented in a separate file. Can you think of...
Read more >Separate Compilation
What are header files for? Multiple source file programs sound great, but there is a problem. While the compiler is willing to accept...
Read more >Separate Compilation and Linking of CUDA C++ Device ...
I assume you're talking about https://github.com/serban/k.... I checked this out and as it is in the repo, the makefile is not setup to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
--device-c
magically solved the issue! (#4470) Thank you very much 👍🏼I don’t know well about Windows, but the Windows compiler probably dosen’t have a -fPIC option, does it?