-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Need help on building OpenCV with CUDA #1609
Comments
When using "-Xcompiler utf-8", you can reproduce the problem.
G:\Temp\tt>nvcc tt.cu -o tt.obj -Xcompiler ,\"/utf-8\"
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).
tt.cu
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/../../VC/INCLUDE\stdint.h(32): warning C4828: The file contains a character starting at offset 0x9aadf that is illegal in the current source character set (codepage 65001).
tt.cu(22): error C2137: empty character constant tt.cu #include <limits>
#include <cstdint>
template<typename T>
class integer_traits
{
public:
static const bool is_integral = false;
};
template<typename T, T min_val, T max_val>
class integer_traits_base
{
public:
static const bool is_integral = true;
static const T const_min = min_val;
static const T const_max = max_val;
};
template<>
class integer_traits<unsigned char>
: public std::numeric_limits<unsigned char>,
public integer_traits_base<unsigned char, 0, UCHAR_MAX>
{}; |
@icedream2linxi Thanks a lot for identifying the problem. I am able to reproduce it with your code. Now I just have to figure out a way to turn off "-Xcompiler utf-8" when compiling. Problem is I have no idea how to adjust the compilation flags in vcpkg. Can @ras0219-msft @KindDragon give me some pointers? |
This is probably being percolated from the Here're the relevant docs: |
@ras0219-msft I don't think it's appropriate to patch the source, because CUDA is actually installed separately by it's own installer. I manually remove the
but it didn't work. Could you give me some pointers on how to remove the utf-8 flag in the opencv portfile? However, after removing the utf-8 flag manually, opencv compiles successfully in release mode but fails to compile in debug mode. Again, I wasn't able to reproduce this if I build OpenCV from source. Below is the error message when OpenCV is compiled in debug mode,
@icedream2linxi Can you help me again on identifying where this compilation error is from ? |
Try to do same for C compiler |
@KindDragon I added that line too but it didn't work unfortunately |
I have also seen this error, did not appear again after building it again.
|
@icedream2linxi I tried rebuilding it 3 times and still see the error... What did you change before building it again? |
I manually remove the /utf-8 in vcpkg_configure_cmake.cmake. portfile.cmake: |
Building environment: triplet: x64-windows |
Today, I rebuilding it 2 times. No error. 😿 config-x64-windows-dbg-out.txt |
I building it on another computer. No error.
config-x64-windows-dbg-out.txt |
@icedream2linxi could you try building with the opencv 3.3 PR #1619 with CUDA enabled? |
I have also encountered the "CMake can not determine linker language for target" error |
This issue seems disappeared with CUDA 9.1 when using with platform toolset v140 under VS2017. |
I just tried with the latest master and it actually compiles now |
I am on vs2015, x64-windows. I am attempting to build OpenCV with CUDA by simply changing the
-DWITH_CUDA=OFF
to-DWITH_CUDA=ON
. In the end I get a compilation error,But the problem is I am unable to reproduce this when building from source with the same cmake options. The module opencv_cudafeatures2d compiles successfully. The whole thing compiles successfully. I browsed through the fix patches for opencv in vcpkg, and nothing looks like it could cause a problem. Could anyone give me some insights?
The text was updated successfully, but these errors were encountered: