Page 1 of 1

Magma 2.5.1 build with cuda 10.1.243 & intel MKL 2019 on Windows 10 1903

Posted: Thu Sep 19, 2019 10:25 pm
by sejabs
I plan build pytorch with cuda 10.1 on windows and want it link to Magma, the fantastic open source heterogeneous computing library. However, I have faced the compile error:
# After long long time consumed to compile different .cu files and different Warnings, like C4819, C4100, C4244 ......
Building NVCC intermediate link file CMakeFiles/magma.dir/Release/magma_intermediate_link.obj
System can't execute specified program.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(220,5): error MSB6006: “cmd.exe” quit, code 9020.
I followed the details in the discuss "Magma in Windows with ILP64".
Could you please have a look?

Many thanks in advance

******************** Build magma.lib and magma_sparse.lib:
OS: Windows 10 1903 18362.356
CUDA: 10.1 update 2 (10.1.243) without cuDNN
Intel MKL: 2019 update 5
CMake: 3.15.3
MSVS 2019: 16.2.5

  • extract magma-2.5.1 from magma-2.5.1.tar.gz into C:\Sci_Dev\Compile;
  • insert add_definitions( -DMKL_ILP64 ) and add_definitions( -DMAGMA_ILP64 ) as the second and third lines of C:\Sci_Dev\Compile\magma-
    Commented out the lines include
    CheckCXXCompilerFlag, CheckCCompilerFlag, set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11"), set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
    because in CMAKE 3.15.3 they reported error:
    The compiler doesn't support the -std=c++11 flag. Some code may not compile.
    The compiler doesn't support the -std=c99 flag. Some code may not compile.
    To solve this warning, I insert
    following above commented lines.
  • open CMake GUI
    Where is the source code: C:/Sci_Dev/Compile/magma-2.5.1
    Where to build the binaries:C:/Sci_Dev/Compile/magma_build
    Current generator: Visual Studio 16 2019
    Use default native compilers X64
    Configure --> wait until Configuring done
  • set GPU_TARGET to: Pascal Volta
    C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows\mkl\lib\intel64_win\mkl_intel_ilp64.lib;
    C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows\mkl\lib\intel64_win\mkl_intel_thread.lib;
    C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows\mkl\lib\intel64_win\mkl_core.lib;
    C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows\compiler\lib\intel64_win\libiomp5md.lib
    set MKLROOT to:
    C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\mkl
    Configure --> wait until Configuring done
    Generate --> wait until Generating done
    close CMake
    • open C:/Sci_Dev/Compile/magma_build\MAGMA.sln --> wait until Ready

      select in toolbar: Release X64

      View --> Solution Explorer

      select both magma and magma_sparse, then right click on the selection:
      --> Properties

      --> C/C++ (click arrow to unfold) --> Code Generation --> set Runtime Library to Multithreaded (/MT)

      --> Configuration Properties (click arrow to unfold) --> VC++ Directories

      --------> add to Library Directories:
      C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows\mkl\lib\intel64_win\
      C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows\compiler\lib\intel64_win\

      --------> add to Include Directories:
      C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows\mkl\include

      select both magma and magma_sparse then select in Build menu: Build Selection --> long long time -_-