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

CUDA9 build fixed, added detection #9418

Merged
merged 3 commits into from
Aug 24, 2017
Merged

CUDA9 build fixed, added detection #9418

merged 3 commits into from
Aug 24, 2017

Conversation

borisfom
Copy link
Contributor

This pullrequest changes

CUDA cmake build setup extended to handle CUDA9
fp16 code changed to accommodate CUDA9 API-breaking changes

@borisfom borisfom force-pushed the cuda9 branch 2 times, most recently from 3ed5dda to 980f43f Compare August 22, 2017 09:55
@alalek
Copy link
Member

alalek commented Aug 24, 2017

Thank you for contribution! Looks good to me 👍

@alalek alalek merged commit c48807c into opencv:master Aug 24, 2017
@borisfom borisfom deleted the cuda9 branch August 24, 2017 19:54
@zwolenik
Copy link

Hi guys,
I try to compile sources with latest version from git using CUDA9. My process of build stops on error bellow:

[94/1185] cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=modules\cudev\CMakeFiles\opencv_cudev.dir --manifests -- C:\PROGRA2\MICROS3\2017\ENTERP1\VC\Tools\MSVC\14111.255\bin\HostX86\x64\link.exe /nologo modules\cudev\CMakeFiles\opencv_cudev.dir\src\stub.cpp.obj modules\cudev\CMakeFiles\opencv_cudev.dir\vs_version.rc.res /out:bin\opencv_cudev330d.dll /implib:lib\opencv_cudev330d.lib /pdb:bin\opencv_cudev330d.pdb /dll /version:3.3 /machine:x64 /debug /INCREMENTAL /NODEFAULTLIB:libc /DEBUG -LIBPATH:C:\PROGRA1\NVIDIA2\CUDA\v9.0\lib\x64 3rdparty\lib\ippiwd.lib 3rdparty\ippicv\ippicv_win\lib\intel64\ippicvmt.lib cudart.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cufft.lib -LIBPATH:"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/lib/x64" cudart.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cufft.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
Creating library lib\opencv_cudev330d.lib and object lib\opencv_cudev330d.exp

[95/1185] cmd.exe /C "cd /D C:\Users\zwolenik\CMakeBuilds\0a3f2040-a587-0f3e-af48-065e0c313449\build\x64-Debug\modules\core\CMakeFiles\cuda_compile.dir\src\cuda && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -E make_directory C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/. && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -D verbose:BOOL=OFF -D build_configuration:STRING=Debug -D generated_file:STRING=C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.obj -D generated_cubin_file:STRING=C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.obj.cubin.txt -P C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.obj.cmake"
FAILED: modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.obj
cmd.exe /C "cd /D C:\Users\zwolenik\CMakeBuilds\0a3f2040-a587-0f3e-af48-065e0c313449\build\x64-Debug\modules\core\CMakeFiles\cuda_compile.dir\src\cuda && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -E make_directory C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/. && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -D verbose:BOOL=OFF -D build_configuration:STRING=Debug -D generated_file:STRING=C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.obj -D generated_cubin_file:STRING=C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.obj.cubin.txt -P C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.obj.cmake"
nvcc fatal : Unsupported gpu architecture 'compute_20'

CMake Error at cuda_compile_generated_gpu_mat.cu.obj.cmake:206 (message):
Error generating
C:/Users/zwolenik/CMakeBuilds/0a3f2040-a587-0f3e-af48-065e0c313449/build/x64-Debug/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.obj

Maybe you can help me what I'm doing wrong. Or maybe provide more information. I started to be familiar with environement - sorry for question but I stuck on this steps and I dont know how to diagnose or push this forward.

Slawek

@alalek
Copy link
Member

alalek commented Aug 28, 2017

nvcc fatal : Unsupported gpu architecture 'compute_20'

Usage questions should go to Users OpenCV Q/A forum: http://answers.opencv.org

@borisfom
Copy link
Contributor Author

Actually, this is about OpenCV detecting correct flags for CUDA - @zwolenik are yuo sure you pull the lasted and do a clean build? After my changes, compute_20 should not be included.

@zwolenik
Copy link

zwolenik commented Aug 29, 2017 via email

@alalek
Copy link
Member

alalek commented Aug 29, 2017

Could you try this fix: #9465 ?

@borisfom
Copy link
Contributor Author

Oh I think I know what it is - auto detection - is your GPU arch CUDA 2.0 ?

xsacha pushed a commit to xsacha/opencv that referenced this pull request Aug 31, 2017
CUDA9 build fixed, added detection (opencv#9418)

* CUDA9 build fixed, added detection

* Replacing deprecated __shfl_xxx with __shfl_sync, fixing bogus CUDA9 warnings
@zwolenik
Copy link

After spending some time I cannot get to this kind of details level. How to manage this and get info? This can be autodetection bug or I need to turn off something on building process?

@borisfom
Copy link
Contributor Author

@zwolenik : I mean, if you have GPU card that is Kepler (2.x CUDA arch) - its not supported by CUDA9. You can still build on that machine if you override flags, but you can't build 2.x code with CUDA9.

@pstieber
Copy link
Contributor

pstieber commented Oct 3, 2017

@borisfom It looks like the inclusion of opencv2/core/private.cuda.hpp in saturate_cast.hpp may be a mistake, because the later file is installed and should not refer to a private include.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: gpu/cuda (contrib) OpenCV 4.0+: moved to opencv_contrib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants