marian/vs
Cédric Rousseau 4fd2360918 Fix CUDA+MSVC incompatibility with Boost.Preprocessor 2018-09-05 15:42:16 +02:00
..
.gitignore Adding scripts and readme file 2018-09-04 16:34:21 +02:00
Marian.sln added VS Solution and Project 2018-08-19 16:18:32 -07:00
Marian.vcxproj fixed Visual Studio projects to actually build the EXE 2018-08-20 14:03:43 -07:00
Marian.vcxproj.filters fixed Visual Studio projects to actually build the EXE 2018-08-20 14:03:43 -07:00
README.md Fix CUDA+MSVC incompatibility with Boost.Preprocessor 2018-09-05 15:42:16 +02:00
build.bat Build in Release, with improved debug info 2018-09-04 16:58:49 +02:00
configure.bat Adding scripts and readme file 2018-09-04 16:34:21 +02:00
paths_for_windows removed old (incorrect) VS files 2018-08-20 13:22:18 -07:00

README.md

Build Marian on Windows with GPU support

Install prerequisites

The following SDK are required to build Marian with GPU support

Patch some files

CUDA: Unsupported Visual Studio Version Error

From nVidia forum

The latest versions of Visual Studio 2017 are not officially supported by CUDA. Two fixes are proposed:

  • Downgrade Visual Studio to a supported version

  • Edit the file <CUDA install path>\include\crt\host_config.h and change the line 131:

    131     #if _MSC_VER < 1600 || _MSC_VER > 1914
    

    into:

    131     #if _MSC_VER < 1600 || _MSC_VER > 1915
    

Configure

  • Run configure.bat

Build

  • Run build.bat

Changes from the master branch

This part gives more information on the changes done.

  1. Fix Cuda error : Unsupported Visual Studio Version Error
    See above for justification and fixes

  2. Fix VS compiler flags / Build in Release, with improved debug info
    Github Link
    Added VS specific compile and link flags

  3. Fix Warning: D9002: ignoring unknown option '-m64'
    Github Link
    This one is related to a compiler flag added while finding the package MKL that does not exists for MS compiler.

  4. Fix marian::Backendn marian::cpu::Beckend and marian::gpu::Backend conflicts
    Github Link
    There were name conflicts between the 3 Backend classes that confused the compiler:

    template instantiation resulted in unexpected function type of "type" (the meaning of a name may have changed since the template declaration -- the type of the template is "type") .

    I renamed the CPU and GPU as cpuBackend and gpuBackend.

  5. Fix error : identifier "CUDA_FLT_MAX" is undefined in device code
    Github Link
    CUDA_FLT_MAX is not seen from the device and I had to declare it as __constant__.

    From StackOverflow:

    Undecorated constants get compiled into both host and device code with gcc based toolchains, but not with the Microsoft compiler.

  6. Fix fatal error C1019: unexpected #else
    Github Link
    There was preprocessor instructions (#ifdef ... #else ... #endif) in the middle of a call of a macro function (CUDNN_CALL), which is not allowed with MS compiler.

  7. Fix mismatched class/struct forward declarations
    Github Link
    Microsoft's C++ name mangling makes a distinction between class and struct objects, so definitions and forward declaration must match.
    See this pdf, page 27, for more information.

  8. Fix unresolved external due to a removed #include directive
    Github Link
    An #include directive was specifically removed for MSVC compiler.

  9. Fix CUDA+MSVC incompatibility with Boost.Preprocessor
    The toolchain nvcc+msvc is not correctly handled in Boost.Preprocessor module. See this issue. In the meantime, the recommended workaround is to disable Variadic Macro support in Boost.