serving icon indicating copy to clipboard operation
serving copied to clipboard

Issue exporting models with CUDA/GPU support

Open parvizp opened this issue 10 years ago • 2 comments

I'm using Bazel 0.2.2, CUDA 7.5, cuDNN v5 on Ubuntu 14.04. After configuring TensorFlow (@ ef7f54f) I'm able to build an example with GPU support:

$ cd tensorflow
$ ./configure
$ bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer

However I'm not able to build TF serving examples with CUDA support. I use the inception_export.py as an example but the real model I want to export uses NCHW and some CPU Ops only support NHWC.

$ cd ..
$ bazel build -c opt --config=cuda //tensorflow_serving/example:inception_export
ERROR: /home/parviz/.cache/bazel/_bazel_parviz/3889ffe662ea382c49c2732eaedd13b5/external/tf/tensorflow/core/kernels/BUILD:1304:1: undeclared inclusion(s) in rule '@tf//tensorflow/core/kernels:scatter_op_gpu':
this rule is missing dependency declarations for the following files included by 'external/tf/tensorflow/core/kernels/scatter_op_gpu.cu.cc':
  '/usr/local/cuda-7.5/include/cuda_runtime.h'
  '/usr/local/cuda-7.5/include/host_config.h'
  '/usr/local/cuda-7.5/include/builtin_types.h'
...
  '/usr/local/cuda-7.5/include/curand_lognormal.h'
  '/usr/local/cuda-7.5/include/curand_poisson.h'
  '/usr/local/cuda-7.5/include/curand_discrete2.h'.
nvcc warning : option '--relaxed-constexpr' has been deprecated and replaced by option '--expt-relaxed-constexpr'.
nvcc warning : option '--relaxed-constexpr' has been deprecated and replaced by option '--expt-relaxed-constexpr'.
Target //tensorflow_serving/example:inception_export failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 18.663s, Critical Path: 18.36s

What is the best approach to serve models with CUDA support? Should I convert to NHWC or is there a way to get CUDA support working?

parvizp avatar May 09 '16 16:05 parvizp

My mistake, I missed the solution here: https://github.com/tensorflow/serving/issues/17 Specifically, adding the following line to tensorflow/third_party/gpus/crosstool/CROSSTOOL: cxx_builtin_include_directory: "/usr/local/cuda-7.5/include"

parvizp avatar May 09 '16 16:05 parvizp

Confirming that this worked for me. Running cuda-7.5 cudnn 4 on aws ubuntu 14.04

rcompton avatar Jun 29 '16 23:06 rcompton