hughperkins / tf-coriander

OpenCL 1.2 implementation for Tensorflow
Apache License 2.0
791 stars 90 forks source link

How can i install on windows #38

Open ShuvenduRoy opened 7 years ago

ShuvenduRoy commented 7 years ago

I have Radoen Rx 470 gpu install on windows 10. Do i have any option for running tensorflow on this gpu

hughperkins commented 7 years ago

Windows ... I'm not sure... I havnet tried. There are a few parts:

I think everything else should be fine. Do you want to try, see how far you can get, report any issues that arise? You'll probably need to fix the issues yourself, but I might be able to give some pointers, possibly.

Edit:

Sticky progress update, using msvc 2015, on branch winbuild of coriander, doc at https://github.com/hughperkins/coriander/blob/winbuild/doc/installation_windows_inprogress.md:

hughperkins commented 7 years ago

oh wait, this is the tensorflow repository. Hmmm... well... I think the first thing would be to try to get coriander working first, ie https://github.com/hughperkins/coriander . Once we have coriander working, we can think about tensorflow itself. How does that sound?

hughperkins commented 7 years ago

(seems like tensorflow itself supports windows , https://www.tensorflow.org/install/install_windows , so as long as coriander works ok on windows, we should stand a chance that tf-coriander works too)

Ray-Eldath commented 7 years ago

I don't really know how to build tf-coriander on windows either...

hughperkins commented 7 years ago

Step 1: download clew, https://github.com/hughperkins/clew check that does/doesn't build, report any issues here.

On 8 June 2017 06:49:19 BST, Eldath notifications@github.com wrote:

I don't really know how to build tf-coriander on windows either...

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/hughperkins/tf-coriander/issues/38#issuecomment-307005340

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

Ray-Eldath commented 7 years ago

Yeah, I build clew successfully. clewTest returned num platforms: 1 that looks like a normal return. What should I do next ?

hughperkins commented 7 years ago

Cool :-) . Next would be to try the next level up:

https://github.com/hughperkins/EasyCL

(EasyCL uses clew, under the hood)

Ray-Eldath commented 7 years ago

Still build successfully, and gpuinfo return correct devices info. Next ?

hughperkins commented 7 years ago

cool :-) . Next one will be harder :P :

https://github.com/hughperkins/coriander

No-one has built this on Windows yet, as far as I know. You are entering uncharted territory :-)

Ray-Eldath commented 7 years ago

Finally, it generated cocl and cocl_wrapped file in dist and when I execute it in Cygwin it return:

Eldath@DESKTOP-RB6STNM ~ $ /cygdrive/f/Code/Research/coriander-master/dist/bin/cocl_wrapped
cocl args:
Usage: /cygdrive/f/Code/Research/coriander-master/dist/bin/cocl_wrapped [-c] [-g] [[-Iincludepath]...] [-o outfile] [infile.cu]

I don't know this means build successfully or not ;-)

hughperkins commented 7 years ago

You're saying, the cmake and build bit finished successfully? (I know cocl wont run yet, but I'm quite pleasantly surprised if the cmake and build bit finished.

How are you building by the way? cygwin? mingsys? visual studio? something else?

hughperkins commented 7 years ago

oh, cygdrive :-)

Hmmmm

Well, then there's a good chance many things will work as-is. You can test by doing things like:

git pull
make tests
make run-cuda_sample

edit: or simply:

../bin/cocl ../test/cocl/cuda_sample.cu
./cuda_sample
Ray-Eldath commented 7 years ago

The cmake works fine. It returns

Configuring done
Generating done

And when I build the project with cmake -DBUILD_TYPE=Release -P cmake_install.cmake (after solve a lot of problems) then it noticed me

CMake Error at cmake_install.cmake:202 (file):
  file INSTALL cannot find
  "F:/Code/Research/coriander-master/build/Release/cocl.dll".
Ray-Eldath commented 7 years ago

All right I'll test it first.

Ray-Eldath commented 7 years ago

cocl is a linux bash file so I only can run this in WSL... but console return an error:

./cocl: line 373: /usr/lib/llvm-3.6/bin/clang++: No such file or directory

How to fix ? And wether run in WSL is equals to run in Windows ?

hughperkins commented 7 years ago

In your case, you probably need to set CLANG_HOME to point to wherever llvm-4.0 directory is, and you probably need to download this first.

hughperkins commented 7 years ago

(Just in case it's useful, I created a Dockerfile, https://github.com/hughperkins/tf-coriander/blob/master/docker/Dockerfile It wont be useful for running of course, since wont be able to use opencl, but does show a full download, build, for ubuntu 16.04. might be helpful-ish? )

Ray-Eldath commented 7 years ago

I run command in Windows PowerShell manual but when I execute

bazel build ${LOCALRESOURCES} ${BUILDTYPE}  @grpc//:grpc_cpp_plugin
bazel build ${LOCALRESOURCES} ${BUILDTYPE} @protobuf//:protoc

it returns:

ERROR: no such package '@grpc//': The repository could not be resolved.
INFO: Elapsed time: 0.739s

and:

ERROR: no such package '@protobuf//': The repository could not be resolved.
INFO: Elapsed time: 0.850s

How to solve this? ;-|

hughperkins commented 7 years ago

Thats a bazel issue. How sure are you coriander is working first? I mean, fixing coriander won't fix this bug. But I'd rather go bit by bit. Can you run all the tests included with coriander, and provide the results please?

On 9 June 2017 07:47:11 BST, Eldath notifications@github.com wrote:

I run command in Windows PowerShell manual but when I execute

bazel build ${LOCALRESOURCES} ${BUILDTYPE}  @grpc//:grpc_cpp_plugin
bazel build ${LOCALRESOURCES} ${BUILDTYPE} @protobuf//:protoc

it returns:

ERROR: no such package '@grpc//': The repository could not be resolved.
INFO: Elapsed time: 0.739s

and:

ERROR: no such package '@protobuf//': The repository could not be
resolved.
INFO: Elapsed time: 0.850s

How to solve this? ;-|

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/hughperkins/tf-coriander/issues/38#issuecomment-307309862

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

eromoe commented 7 years ago

Hi @hughperkins Does https://github.com/hughperkins/clew must need VS2010 on windows? Is there any lighter substituter ?

hughperkins commented 7 years ago

@eromoe Should build on anything I would think. Might need -std=c++, but some base c++ might be sufficient actually. [edit: actually, c99 is probably sufficient, dont think it uses c++ at all actually]

That's probably true for EasyCL too. [edit: well, easycl uses c++, probably c++98 is sufficient though, no need for -std=c++11

Coriander needs -std=c++11. So msvc2010 is not sufficinet. You probably need msvc2015, if you're giong to go msvc route. Otherwise, you could use cygwin or msys, if you prefer, plausibly.

What compiler do you normally prefer to use? Or, do you mean, you'd prefer to have pre-built Windows binaries?

eromoe commented 7 years ago

Actually, I am not familiar with c++. I know cygwin ad msys are something linux emulators. But they looks lighter than msvc2015 , so I may prefer to. But I wonder , are the building steps as same as ubuntu if I choose cygwin or msys? I just hope it is not so complex.

PS: The building enviroment usually make me headache. There are many different settings or dependencies on each platfom/env . I always admire your guys who can write the right config and steps . What I know is just follow the installation guide, once got error directly game over and cry for help. Do you have any suggesttion for my situation?

hughperkins commented 7 years ago

Looks like there are commandline tools available, dont need full ide, http://landinghub.visualstudio.com/visual-cpp-build-tools

hughperkins commented 7 years ago

Note: Coriadne build on Windows is in progress on branch 'winbuild', of Coriander, https://github.com/hughperkins/coriander/tree/winbuild

hughperkins commented 7 years ago

(and doc is here: https://github.com/hughperkins/coriander/blob/winbuild/doc/installation_windows_inprogress.md )

hughperkins commented 7 years ago

Update:

hughperkins commented 7 years ago

Hmmm, as far as which compiler to use when building application source-code...

hughperkins commented 7 years ago

Seems like the clang++, from http://releases.llvm.org/download.html#4.0.0 can at least build cuda_sample.cu into NVIDIA® CUDA™ bytecode, using msvc 2015 headers:

screen shot 2017-06-18 at 8 43 45 am screen shot 2017-06-18 at 8 44 05 am

Warnings are ok, compile errors would be less good.

Coriander binaries are building ok now, on Windows 64-bit, using msvc2015.

Next step is to modify the bash script at https://github.com/hughperkins/coriander/blob/master/bin/cocl , to be a python script.

hughperkins commented 7 years ago

Update: on the winbuild branch, there is a new command available cocl_py, instead of cocl, which uses python, instead of bash, so should be portable, cross-platform. The endtoend coriander tests pass using this. The eigen tests fail for some reason. I'm not going to look into why just now, but some simple comparison of the options being fed to clang++ in one with those fed to clang++ by the other should be sufficient to fix that. I think I'm going to take a braek from the Windows thing for a while, and look at eg thrust instead, so please feel free to pick up the reins on this for a bit :-)

(Edit: by the way, this commit reverts from using cocl_py as the default, back to cocl, so I can merge to master-ish. To set it to default, once it's fully working on eigne tests, just do the reverse of what is in this commit basically)

hughperkins commented 7 years ago

(finally I have merged winbuild branch onto master, with the cocl script now marked as deprecated, and cocl_py the preferred entrypoint)

milaandahiya commented 7 years ago

This issue is about 3 months old, so I am not going to read each comment, but is tf-coriander working on Windows yet? Thanks!

hughperkins commented 7 years ago

It was briefly working somewhat, but I havent been checking it continues working on Windows, so it might need a bit of love to get it working again plausibly.

milaandahiya commented 7 years ago

@hughperkins Is it pretty easy to get working, or does it require quite a bit of tweaking?

hughperkins commented 7 years ago

The latter.

milaandahiya commented 7 years ago

@hughperkins Do you think you could write a small tutorial, or is it too complicated?

bean710 commented 7 years ago

@hughperkins I'm getting an error on step 14 of installing coriander. In CMake I am getting this error:

CMake Error at test/CMakeLists.txt:22 (cocl_add_executable): Unknown CMake command "cocl_add_executable". Call Stack (most recent call first): CMakeLists.txt:294 (include)

n-rocher commented 6 years ago

Hi ! I would like to know if anyone as compile this on Windows ? :)

akostadinov commented 6 years ago

I'm using python 27 and vs2015 as installed by npm install --global windows-build-tools. Just because I already had these already. Compiled LLVM with cmake 3.10.3 without issues by command line

cmake-gui ...
msbuild LLVM.sln
msbuild INSTALL.vcxproj # as admin

On step 14 I'm getting:

CMake Error at test/eigen/CMakeLists.txt:37 (include):
  include could not find load file:

    /coriander/lib/coriander_plugins/corianderclblast-targets.cmake

Tried to install that plugin first to no avail. I think my issue is that I can't really understand what to put as CMAKE_INSTALL_PREFIX which defaults to /coriander.

Any clues?

Update: tried to disable test building. Now configure and generate worked fine but I've got compile issues - https://paste.fedoraproject.org/paste/OVkJvgstvqUPoHeLsQ-GMw . Here is short version for when pastebin expires:

Build FAILED.

"C:\Users\pesho\Downloads\repos\coriander\build\cocl.vcxproj" (default target) (1) ->
"C:\Users\pesho\Downloads\repos\coriander\build\easycl.vcxproj" (default target) (4) ->
(ClCompile target) ->
  c:\users\pesho\downloads\repos\coriander\src\easycl\util/easycl_stringhelper.h(22): warning C4091: '__declspec(dllexp
ort)': ignored on left of 'easycl::IHasToString' when no variable is declared [C:\Users\pesho\Downloads\repos\coriander
\build\easycl.vcxproj]
  c:\users\pesho\downloads\repos\coriander\src\easycl\util/easycl_stringhelper.h(22): warning C4091: '__declspec(dllexp
ort)': ignored on left of 'easycl::IHasToString' when no variable is declared [C:\Users\pesho\Downloads\repos\coriander
\build\easycl.vcxproj]
  c:\users\pesho\downloads\repos\coriander\src\easycl\util/easycl_stringhelper.h(22): warning C4091: '__declspec(dllexp
ort)': ignored on left of 'easycl::IHasToString' when no variable is declared [C:\Users\pesho\Downloads\repos\coriander
\build\easycl.vcxproj]
  C:\Users\pesho\Downloads\repos\coriander\src\EasyCL\util/easycl_stringhelper.h(22): warning C4091: '__declspec(dllexp
ort)': ignored on left of 'easycl::IHasToString' when no variable is declared [C:\Users\pesho\Downloads\repos\coriander
\build\easycl.vcxproj]

"C:\Users\pesho\Downloads\repos\coriander\build\cocl.vcxproj" (default target) (1) ->
"C:\Users\pesho\Downloads\repos\coriander\build\easycl.vcxproj" (default target) (4) ->
(ClCompile target) ->
  C:\Users\pesho\Downloads\repos\coriander\src\EasyCL\CLKernel.cpp(366): error C2131: expression did not evaluate to a
constant [C:\Users\pesho\Downloads\repos\coriander\build\easycl.vcxproj]
  C:\Users\pesho\Downloads\repos\coriander\src\EasyCL\CLKernel.cpp(372): error C2664: 'cl_int (cl_event)': cannot conve
rt argument 1 from 'cl_event [numOutputBuffers]' to 'cl_event' [C:\Users\pesho\Downloads\repos\coriander\build\easycl.v
cxproj]

    4 Warning(s)
    2 Error(s)

P.S. I see in hughperkins/coriander#62 that somebody had some success on windows.