Skip to content

Add windows install instructions #264

Open

Description

@adler-j

Currently the INSTALL file says: "I have no idea how to install on Windows.", not very helpful.

For me the following steps were enough to install libgpuarray:

  • Clone the library from GitHub.
  • Create build folder, open CMake gui
  • Change CMAKE_INSTALL_PREFIX to libgpuarray/lib. Perhaps this should be default on windows.
  • Configure and generate.
  • Open the .sln file with Visual Studio
  • Build the INSTALL package (needs PR Remove string definition with no length in gpuarray_buffer_opencl, see #262 #263)
  • Manually move the dll's to somewhere in the PATH. Perhaps we should automate this on windows.
  • Build the Cython extension (in the libgpuarray root) with: python setup.py build_ext --compiler=msvc
  • Install the package with python setup.py install

Now everything works.

Should we add instructions for this somewhere, if so, where?

Activity

  1. abergeron commented on Sep 29, 2016

    @abergeron
    Member

    If you want to update the documentation with these instructions, I will be very open to this. They should go in doc/installation.rst

  2. iceman121 commented on Oct 10, 2016

    @iceman121

    Hey I'm having trouble building the INSTALL package. Getting the following errors (using Visual Studio 2013):

    Error   15  error C2057: expected constant expression   C:\gpuarray\libgpuarray\src\util\integerfactoring.c 830 1   gpuarray
    Error   16  error C2466: cannot allocate an array of constant size 0    C:\gpuarray\libgpuarray\src\util\integerfactoring.c 830 1   gpuarray
    Error   17  error C2133: 'pInd' : unknown size  C:\gpuarray\libgpuarray\src\util\integerfactoring.c 830 1   gpuarray
    Error   32  error C2057: expected constant expression   C:\gpuarray\libgpuarray\src\util\integerfactoring.c 830 1   gpuarray-static
    Error   33  error C2466: cannot allocate an array of constant size 0    C:\gpuarray\libgpuarray\src\util\integerfactoring.c 830 1   gpuarray-static
    Error   34  error C2133: 'pInd' : unknown size  C:\gpuarray\libgpuarray\src\util\integerfactoring.c 830 1   gpuarray-static
    Error   35  error MSB3073: The command "setlocal
    "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
    if %errorlevel% neq 0 goto :cmEnd
    :cmEnd
    endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
    :cmErrorLevel
    exit /b %1
    :cmDone
    if %errorlevel% neq 0 goto :VCEnd
    :VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets  132 5   INSTALL
    

    Any idea why I am facing this and what I can do to resolve?

    Thanks.

  3. abergeron commented on Oct 11, 2016

    @abergeron
    Member

    There was some unsupported code for MSCV in a recent PR. This has been fixed and the master should work now.

  4. iceman121 commented on Oct 11, 2016

    @iceman121

    Hey, I tried building again with the fixed version, got the following error:

    Error   969 error LNK2019: unresolved external symbol snprintf referenced in function gaIFLsnprintf C:\libgpuarray-master\libgpuarray-master\Build\src\integerfactoring.obj gpuarray
    Error   970 error LNK1120: 1 unresolved externals   C:\libgpuarray-master\libgpuarray-master\lib\Debug\gpuarray.dll gpuarray
    Error   971 error MSB3073: The command "setlocal
    "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
    if %errorlevel% neq 0 goto :cmEnd
    :cmEnd
    endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
    :cmErrorLevel
    exit /b %1
    :cmDone
    if %errorlevel% neq 0 goto :VCEnd
    :VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets  132 5   INSTALL
    
  5. abergeron commented on Oct 11, 2016

    @abergeron
    Member

    Ok, we need to remove the call to snprintf also.

  6. iceman121 commented on Oct 12, 2016

    @iceman121

    Okay, please let me know when it is ready to clone. Thanks.

  7. abergeron commented on Oct 12, 2016

    @abergeron
    Member

    There is this #275.

    I don't know when someone will have time to review.

  8. nouiz commented on Oct 12, 2016

    @nouiz
    Member

    I merged it.

    On Wed, Oct 12, 2016 at 11:33 AM, abergeron notifications@github.com
    wrote:

    There is this #275 #275.

    I don't know when someone will have time to review.

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #264 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AALC-_QvJ3lMCkwezrd0oLmG5ZhUCxiKks5qzP3hgaJpZM4KKOdR
    .

  9. iceman121 commented on Oct 12, 2016

    @iceman121

    So good news, I was able to build successfully.

    I point out some steps to add to windows installation.

    1. The INSTALL package needs to be built with admin privileges in release mode. So this needs to be built in the Visual Studio Developer Command Prompt with "msbuild libgpuarray.sln /p:Configuration=Release"
    2. Restart is necessary after installing pygpu

    I should point out that I tried running theano after this, but the kernel crashed. However, when I changed the device = gpu0 in the .theanorc.txt file from device = cuda, it worked just fine.

    Thank you for all your help. You guys are great!

  10. adler-j commented on Oct 13, 2016

    @adler-j
    ContributorAuthor

    Great, I'll try to get to writing these instructions sometime soon.

  11. nouiz commented on Oct 14, 2016

    @nouiz
    Member

    device=gpu use the old backend. So the crash still need to be fixed.

    Le 13 oct. 2016 02:44, "Jonas Adler" notifications@github.com a écrit :

    Great, I'll try to get to writing these instructions sometime soon.

    —
    You are receiving this because you commented.
    Reply to this email directly, view it on GitHub
    #264 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AALC-2JWqRe7FzjxfcaDWX0Wpe8ONFvjks5qzdNpgaJpZM4KKOdR
    .

  12. added this to the 0.6 milestone on Jan 12, 2017
  13. nouiz commented on Jan 12, 2017

    @nouiz
    Member

    Just to note that we are working on conda packages. This will probably be the only supported way to install it for user. We can't support all combination of compiler on all platform we have.

  14. nouiz commented on Jan 12, 2017

    @nouiz
    Member

    So mostly, this issue is about adding install instruction with conda on windows. Not the full installation.

  15. adler-j commented on Feb 13, 2017

    @adler-j
    ContributorAuthor

    Any update on the conda packages?

  16. 28 remaining items

  17. notoraptor commented on Jun 6, 2017

    @notoraptor
    Contributor

    Hello ! Do you use the same Python environment in both Spyder and command line ? Also, which version of GCC do you use ? We recommend the version provided by conda package m2w64-toolchain: http://deeplearning.net/software/theano/install_windows.html#install-requirements-and-optional-packages .

  18. abergeron commented on Jun 6, 2017

    @abergeron
    Member

    @michaelklachko fastmath is always disabled because we often had problem with wrong results due to the reduced precision. In addition to that the NVIDIA docs don't recommend that it be enabled anymore.

  19. iceman121 commented on Jun 11, 2017

    @iceman121

    @notoraptor Sorry for the late response. In Spyder I was using the iPython interpreter. The command line uses the default console python interpreter.

  20. notoraptor commented on Jun 12, 2017

    @notoraptor
    Contributor

    @iceman121 What is the version of your console Python interpreter (result of command python -V), and what is the version of your Spyder's IPython ? Also, do you use a conda environment either in console or Spyder ?

  21. iceman121 commented on Jun 12, 2017

    @iceman121

    @notoraptor

    Python version= 3.5.3
    IPython = 6.0.0

    Use of Conda environment= No.

  22. abergeron commented on Jun 12, 2017

    @abergeron
    Member

    I just want to note that we only support conda packages on windows for pygpu/libgpuarray.

  23. notoraptor commented on Jun 15, 2017

    @notoraptor
    Contributor

    Hello, @iceman121 . Sorry for late response, I was not working on Windows these las days.

    But your problem is quite strange. Could you give the full output of following commands ?

    In command line:

    where python
    python -V
    gcc -v
    conda info --envs

    In Spyder IPython:

    import sys
    print(sys.version)
    print(sys.prefix)

    The goal is to check if the Python interpreter in your command line is the same as the one in Spyder (do you have many Python installations in your system ?).

  24. iceman121 commented on Jun 15, 2017

    @iceman121

    Hi @notoraptor
    Please find below-

    In command line:

    where python
    C:\Continuum\python.exe
    
    python -V
    Python 3.5.3 :: Anaconda custom (64-bit)
    
    gcc -v
    Using built-in specs.
    COLLECT_GCC=C:\Continuum\Scripts\gcc.bat\..\..\MinGW\bin\gcc.exe
    COLLECT_LTO_WRAPPER=c:/continuum/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/lto-wrapper.exe
    Target: x86_64-w64-mingw32
    Configured with: ../../../build/gcc/src/configure --target=x86_64-w64-mingw32 --prefix=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --with-sysroot=/c
    /bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --enable-languages=all,obj-c++ --enable-fully-dynamic-string --disable-multilib
    Thread model: win32
    gcc version 4.7.0 20111220 (experimental) (GCC)
    
    conda info --envs
    # conda environments:
    #
    root                  *  C:\Continuum
    

    For Spyder IPython:

    print(sys.version)
    3.5.3 |Anaconda custom (64-bit)| (default, May 15 2017, 10:43:23) [MSC v.1900 64 bit (AMD64)]
    
    print(sys.prefix)
    C:\Continuum
    

    As far as I remember I have only one interpreter on my system. I think this validates it.

  25. notoraptor commented on Jun 16, 2017

    @notoraptor
    Contributor

    Hello, @iceman121 , indeed, it seems there is only 1 Python installation. Quite strange that theano GPU test works in Spyder but not in console.

    The last thing I could suggest is (in command line):

    1. Check that you use m2w64-toolchain as gcc package (conda install m2w64-toolchain). If this package is installed, maybe you could find a gcc program in C:\Continuum\Library\mingw-w64\bin\ ?
    2. Make sure default conda environment (root) is activated (activate root).
    3. Once root env is activated, then try theano test again. Also run where gcc to check if conda gcc package is indeed used in conda env.
  26. iceman121 commented on Jun 16, 2017

    @iceman121

    @notoraptor Results below:

    1. Found the gcc.exe in the Library location.
    2. Done.
    3. Tried, failed. where gcc responds as the same location.
  27. notoraptor commented on Jun 16, 2017

    @notoraptor
    Contributor

    Ok.

    It seems I am encountering a similar problem as you, but with Python 3.5, not with Python 2.7.

    Could you try to create a conda environment with Python 2.7 (e.g. conda create -n python2 python=2, then activate python2), install everything needed in that env ( http://www.deeplearning.net/software/theano_versions/dev/install_windows.html ) and check if theano GPU test works on command line with this environment ?

    I'll check this issue for Python 3.5.

  28. modified the milestones: 0.6.10, 0.6 on Jul 31, 2017
  29. ankushbbbr commented on Sep 23, 2017

    @ankushbbbr

    I have installed m2w64-toolchain and still getting the following error with libgpuarray.

    Can not use cuDNN on context None: cannot compile with cuDNN. We got this error:
    b'C:/Users/ankushbabbar/Miniconda2/envs/dlwin36/Library/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcudnn\r\ncollect2.exe: error: ld returned 1 exit status\r\n'

    I'm using the follwing THEANO_FLAGS
    THEANO_FLAGS=floatX=float32,device=cuda0,optimizer_including=cudnn,gpuarray.preallocate=0.8,dnn.conv.algo_bwd_filter=deterministic,dnn.conv.algo_bwd_data=deterministic,dnn.include_path=F:\Softwares\fast_ai\CUDA\v8.0\include,dnn.library_path=F:\Softwares\fast_ai\CUDA\v8.0\lib\x64

  30. abergeron commented on Sep 25, 2017

    @abergeron
    Member

    The problem seems to be that you don't specify a bin_path for cudnn (which is important on windows).

    However, instead of specifying all the individual paths by hand try using the following flag instead of dnn.include_path and dnn.library_path: cuda.root=F:\Softwares\fast_ai\CUDA\v8.0 This should set all the other dnn flags automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions