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

Add Windows GPU support with Bazel #5644

Merged
merged 8 commits into from Nov 17, 2016

Conversation

Projects
None yet
5 participants
@meteorcloudy
Member

meteorcloudy commented Nov 16, 2016

@mrry @dslomov @damienmg

The change needed for Bazel is also ready to review:
https://bazel-review.googlesource.com/?polygerrit=0#/c/7351/
Once these changes are checked in, we should be able to build TensorFlow with GPU support on Windows by
bazel build --confg=win-cuda -c opt --cpu=x64_windows_msvc --cpu=x64_windows tensorflow/tools/pip_package:build_pip_package

I excluded depthwise_conv_grad_op which doesn't seem to be excluded in CMake build.
It caused a linking error like this, and only happens in GPU build:

depthwise_conv_grad_op.o : error LNK2019: unresolved external symbol "public: static void __cdecl tensorflow::DepthwiseConv2dBackpropInputGPULaunch<float>::Run(struct Eigen::GpuDevice const &,struct tensorflow::DepthwiseArgs,float const *,float const *,float *)" (?Run@?$DepthwiseConv2dBackpropInputGPULaunch@M@tensorflow@@SAXAEBUGpuDevice@Eigen@@UDepthwiseArgs@2@PEBM2PEAM@Z) referenced in function "public: static void __cdecl tensorflow::LaunchDepthwiseConvBackpropInputOp<struct Eigen::GpuDevice,float>::launch(class tensorflow::OpKernelContext *,struct tensorflow::DepthwiseArgs,float const *,float const *,float *)" (?launch@?$LaunchDepthwiseConvBackpropInputOp@UGpuDevice@Eigen@@M@tensorflow@@SAXPEAVOpKernelContext@2@UDepthwiseArgs@2@PEBM2PEAM@Z)
depthwise_conv_grad_op.o : error LNK2019: unresolved external symbol "public: static void __cdecl tensorflow::DepthwiseConv2dBackpropInputGPULaunch<double>::Run(struct Eigen::GpuDevice const &,struct tensorflow::DepthwiseArgs,double const *,double const *,double *)" (?Run@?$DepthwiseConv2dBackpropInputGPULaunch@N@tensorflow@@SAXAEBUGpuDevice@Eigen@@UDepthwiseArgs@2@PEBN2PEAN@Z) referenced in function "public: static void __cdecl tensorflow::LaunchDepthwiseConvBackpropInputOp<struct Eigen::GpuDevice,double>::launch(class tensorflow::OpKernelContext *,struct tensorflow::DepthwiseArgs,double const *,double const *,double *)" (?launch@?$LaunchDepthwiseConvBackpropInputOp@UGpuDevice@Eigen@@N@tensorflow@@SAXPEAVOpKernelContext@2@UDepthwiseArgs@2@PEBN2PEAN@Z)
depthwise_conv_grad_op.o : error LNK2019: unresolved external symbol "public: static void __cdecl tensorflow::DepthwiseConv2dBackpropFilterGPULaunch<float>::Run(struct Eigen::GpuDevice const &,struct tensorflow::DepthwiseArgs,float const *,float const *,float *)" (?Run@?$DepthwiseConv2dBackpropFilterGPULaunch@M@tensorflow@@SAXAEBUGpuDevice@Eigen@@UDepthwiseArgs@2@PEBM2PEAM@Z) referenced in function "public: static void __cdecl tensorflow::LaunchDepthwiseConvBackpropFilterOp<struct Eigen::GpuDevice,float>::launch(class tensorflow::OpKernelContext *,struct tensorflow::DepthwiseArgs,float const *,float const *,float *)" (?launch@?$LaunchDepthwiseConvBackpropFilterOp@UGpuDevice@Eigen@@M@tensorflow@@SAXPEAVOpKernelContext@2@UDepthwiseArgs@2@PEBM2PEAM@Z)
depthwise_conv_grad_op.o : error LNK2019: unresolved external symbol "public: static void __cdecl tensorflow::DepthwiseConv2dBackpropFilterGPULaunch<double>::Run(struct Eigen::GpuDevice const &,struct tensorflow::DepthwiseArgs,double const *,double const *,double *)" (?Run@?$DepthwiseConv2dBackpropFilterGPULaunch@N@tensorflow@@SAXAEBUGpuDevice@Eigen@@UDepthwiseArgs@2@PEBN2PEAN@Z) referenced in function "public: static void __cdecl tensorflow::LaunchDepthwiseConvBackpropFilterOp<struct Eigen::GpuDevice,double>::launch(class tensorflow::OpKernelContext *,struct tensorflow::DepthwiseArgs,double const *,double const *,double *)" (?launch@?$LaunchDepthwiseConvBackpropFilterOp@UGpuDevice@Eigen@@N@tensorflow@@SAXPEAVOpKernelContext@2@UDepthwiseArgs@2@PEBN2PEAN@Z)
bazel-out/vc_14_0_x64-py3-opt/bin/tensorflow/cc/tutorials_example_trainer.exe : fatal error LNK1120: 4 unresolved externals
Target //tensorflow/cc:tutorials_example_trainer failed to build
INFO: Elapsed time: 2180.664s, Critical Path: 1792.27s

The source file depthwise_conv_grad_op.cc looks weird to me, because the syntax highlight starts go wrong from line 113. Might need some help to resolve this.

@googlebot googlebot added the cla: yes label Nov 16, 2016

@mention-bot

This comment has been minimized.

Show comment
Hide comment
@mention-bot

mention-bot Nov 16, 2016

@meteorcloudy, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vrv, @keveman and @davidzchen to be potential reviewers.

mention-bot commented Nov 16, 2016

@meteorcloudy, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vrv, @keveman and @davidzchen to be potential reviewers.

@meteorcloudy

This comment has been minimized.

Show comment
Hide comment
@meteorcloudy

meteorcloudy Nov 16, 2016

Member

There is still an issue that the pip package is trying to load dll libraries with the wrong name on Windows.
Mentioned here: bazelbuild/bazel#2075
I'll fix it after PR #5494 is merged, need to resolve some conflict anyway.

Member

meteorcloudy commented Nov 16, 2016

There is still an issue that the pip package is trying to load dll libraries with the wrong name on Windows.
Mentioned here: bazelbuild/bazel#2075
I'll fix it after PR #5494 is merged, need to resolve some conflict anyway.

Show outdated Hide outdated configure
Show outdated Hide outdated tensorflow/core/BUILD
Show outdated Hide outdated tensorflow/core/BUILD
Show outdated Hide outdated tensorflow/python/BUILD
@mrry

mrry approved these changes Nov 16, 2016

LGTM, this is great!

@meteorcloudy

This comment has been minimized.

Show comment
Hide comment
@meteorcloudy

meteorcloudy Nov 17, 2016

Member

Jenkins, test this please.

Member

meteorcloudy commented Nov 17, 2016

Jenkins, test this please.

@meteorcloudy

This comment has been minimized.

Show comment
Hide comment
@meteorcloudy

meteorcloudy Nov 17, 2016

Member

Jenkins, test this please.

Member

meteorcloudy commented Nov 17, 2016

Jenkins, test this please.

@rmlarsen rmlarsen merged commit 4c094d1 into tensorflow:master Nov 17, 2016

10 checks passed

Android Demo App SUCCESS
Details
Linux CPU Tests SUCCESS
Details
Linux CPU Tests (Python 3) SUCCESS
Details
Linux CPU Tests CMAKE SUCCESS
Details
Linux GPU SUCCESS
Details
MacOS CPU Tests SUCCESS
Details
Sanity Checks SUCCESS
Details
Windows Cmake Tests SUCCESS
Details
ci.tensorflow.org SUCCESS
Details
cla/google All necessary CLAs are signed

@meteorcloudy meteorcloudy deleted the meteorcloudy:windows-gpu-support-with-bazel branch Mar 29, 2017

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