Skip to content

Instantly share code, notes, and snippets.

@kern
Last active August 22, 2016 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kern/dcf5a7c04e5697364651 to your computer and use it in GitHub Desktop.
Save kern/dcf5a7c04e5697364651 to your computer and use it in GitHub Desktop.
Patch to allow TensorFlow to run on CUDA Compute 3.0
diff --git a/tensorflow/core/common_runtime/gpu/gpu_device.cc b/tensorflow/core/common_runtime/gpu/gpu_device.cc
index 26d3464..286123f 100644
--- a/tensorflow/core/common_runtime/gpu/gpu_device.cc
+++ b/tensorflow/core/common_runtime/gpu/gpu_device.cc
@@ -607,7 +607,7 @@ void BaseGPUDeviceFactory::GetValidDeviceIds(std::vector<int>* ids) {
}
// Only consider GPUs with compute capability >= 3.5 (Kepler or
// higher)
- if (major < 3 || (major == 3 && minor < 5)) {
+ if (major < 3 /*|| (major == 3 && minor < 5)*/) {
LOG(INFO) << "Ignoring gpu device "
<< "(" << GetShortDeviceDescription(i, desc) << ") "
<< "with Cuda compute capability " << major << "." << minor
diff --git a/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc b/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc
index 0f419a8..8b7ebd4 100755
--- a/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc
+++ b/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc
@@ -233,6 +233,7 @@ def InvokeNvcc(argv, log=False):
out = ' -o ' + out_file[0]
nvccopts = ' '.join([
+ r'-gencode=arch=compute_30,\"code=sm_30,compute_30\"',
r'-gencode=arch=compute_35,\"code=sm_35,compute_35\"',
r'-gencode=arch=compute_52,\"code=sm_52,compute_52\"',])
nvccopts += ' ' + nvcc_compiler_options
@combatpoodle
Copy link

<3

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