Skip to content
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

GPU device not found on OSX #875

Closed
maxgillett opened this issue Jan 25, 2016 · 2 comments
Closed

GPU device not found on OSX #875

maxgillett opened this issue Jan 25, 2016 · 2 comments

Comments

@maxgillett
Copy link

Hello,

I'm trying to install TensorFlow with GPU support for a CUDA Capability 3.0 device. I have followed the instructions found here: https://gist.github.com/Mistobaan/dd32287eeb6859c6668d, and everything compiles without error, but TensorFlow doesn't recognize my GPU device. The steps that I'm taking are below, as is the error output.

I've modified bazel to use gcc-4.8, so these are the commands I'm running:

bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer ---crosstool_top=//tools/cpp:toolchain
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --crosstool_top=//tools/cpp:toolchain

Running the example with:

bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu

produces the following output:

F tensorflow/cc/tutorials/example_trainer.cc:118] Check failed: ::tensorflow::Status::OK() == (session->Run({{"x", x}}, {"y:0", "y_normalized:0"}, {}, &outputs)) (OK vs. Invalid argument: Cannot assign a device to node 'Const/_2': Could not satisfy explicit device specification '/gpu:0'
     [[Node: Const/_2 = Const[dtype=DT_INT32, value=Tensor<type: int32 shape: [] values: 0>, _device="/gpu:0"]()]])
F tensorflow/cc/tutorials/example_trainer.cc:118] Check failed: ::tensorflow::Status::OK() == (session->Run({{"x", x}}, {"y:0", "y_normalized:0"}, {}, &outputs)) (OK vs. Invalid argument: Cannot assign a device to node 'Const/_2': Could not satisfy explicit device specification '/gpu:0'
     [[Node: Const/_2 = Const[dtype=DT_INT32, value=Tensor<type: in

I can also confirm that after installing the pip package and running a test script, no devices are found.

A few things to note:

  • Running deviceQuery confirms that a CUDA device (Device 0: GeForce GT 650M) is found.
  • I've made sure to run bazel clean before compiling, and have tried compiling using sudo just to see if this was a permissions issue.

Thanks in advance for your help.

@maxgillett maxgillett changed the title GPU device not found GPU device not found on OSX Jan 25, 2016
@maxgillett
Copy link
Author

EDIT: I can successfully compile also with Clang 7.0.2, which I can confirm is supported by NVCC. I'm still getting the same error as above.

It turns out that I was actually compiling with gcc-5, not gcc-4.8. From what I can tell CUDA doesn't support version 5, so this might be the problem.

I'm trying now to compile with 4.8, but I'm getting this error:

/var/tmp//cccfsYPu.s:2774:expecting string instruction after `rep'~~

From what I've read this seems to be a problem with binutils (at least on Linux), so I installed binutils 2.25.1 with Homebrew, but it didn't help. I've also tried including the compiler flag `-march=corei7'

@vrv
Copy link

vrv commented Feb 6, 2016

De-duping with #491

@vrv vrv closed this as completed Feb 6, 2016
tarasglek pushed a commit to tarasglek/tensorflow that referenced this issue Jun 20, 2017
Added -D_GLIBCXX_USE_CXX11_ABI=0 to support g++ version 5 for word2vec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@vrv @maxgillett and others