{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/12474","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/12474/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/12474/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/12474/events","html_url":"https://github.com/tensorflow/tensorflow/issues/12474","id":251834024,"number":12474,"title":"CUDA 9RC + cuDNN7","user":{"login":"tfboyd","id":23486130,"avatar_url":"https://avatars1.githubusercontent.com/u/23486130?v=4","gravatar_id":"","url":"https://api.github.com/users/tfboyd","html_url":"https://github.com/tfboyd","followers_url":"https://api.github.com/users/tfboyd/followers","following_url":"https://api.github.com/users/tfboyd/following{/other_user}","gists_url":"https://api.github.com/users/tfboyd/gists{/gist_id}","starred_url":"https://api.github.com/users/tfboyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfboyd/subscriptions","organizations_url":"https://api.github.com/users/tfboyd/orgs","repos_url":"https://api.github.com/users/tfboyd/repos","events_url":"https://api.github.com/users/tfboyd/events{/privacy}","received_events_url":"https://api.github.com/users/tfboyd/received_events","type":"User","site_admin":false},"labels":[{"id":473173272,"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/type:feature","name":"type:feature","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":{"login":"tfboyd","id":23486130,"avatar_url":"https://avatars1.githubusercontent.com/u/23486130?v=4","gravatar_id":"","url":"https://api.github.com/users/tfboyd","html_url":"https://github.com/tfboyd","followers_url":"https://api.github.com/users/tfboyd/followers","following_url":"https://api.github.com/users/tfboyd/following{/other_user}","gists_url":"https://api.github.com/users/tfboyd/gists{/gist_id}","starred_url":"https://api.github.com/users/tfboyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfboyd/subscriptions","organizations_url":"https://api.github.com/users/tfboyd/orgs","repos_url":"https://api.github.com/users/tfboyd/repos","events_url":"https://api.github.com/users/tfboyd/events{/privacy}","received_events_url":"https://api.github.com/users/tfboyd/received_events","type":"User","site_admin":false},"assignees":[{"login":"tfboyd","id":23486130,"avatar_url":"https://avatars1.githubusercontent.com/u/23486130?v=4","gravatar_id":"","url":"https://api.github.com/users/tfboyd","html_url":"https://github.com/tfboyd","followers_url":"https://api.github.com/users/tfboyd/followers","following_url":"https://api.github.com/users/tfboyd/following{/other_user}","gists_url":"https://api.github.com/users/tfboyd/gists{/gist_id}","starred_url":"https://api.github.com/users/tfboyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfboyd/subscriptions","organizations_url":"https://api.github.com/users/tfboyd/orgs","repos_url":"https://api.github.com/users/tfboyd/repos","events_url":"https://api.github.com/users/tfboyd/events{/privacy}","received_events_url":"https://api.github.com/users/tfboyd/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-08-22T04:20:42Z","updated_at":"2017-08-22T05:51:23Z","closed_at":null,"body":"This is an **unofficial** and **very** not supported patch to make it possible to compile TensorFlow with CUDA9RC and cuDNN 7.  This should also works for CUDA 8 + cuDNN 7 but skip the EIGEN patch if using CUDA 8.   \r\n\r\nDuring testing on V100 (Volta) and ResNet-50 FP32  using CUDA 9RC + cuDNN 7 was significantly faster than CUDA 8 + cuDNN 6, which was not a surprise.  I am about to test on P100s.  I am sharing this patch informally so those that are interested can play with cuDNN 7 as well as CUDA 9RC before we have the official release.  As we have more interesting code, e.g FP16 models, I will share it in this issue.   I expect NVIDIA will start to submit official cuDNN 7 patches very soon.  \r\n\r\n**Note:**  This patch may work on more recent versions of TensorFlow but it will likely bit rot so keep that in mind.  Apply the cuDNN 7 patch and then fast-forwarding the branch might be the best approach.  My git skills are not strong so do what you think is best.  \r\n\r\n1. Download the patches\r\n- [0001-CUDA-9.0-and-cuDNN-7.0-support.patch](https://storage.googleapis.com/tf-performance/public/cuda9rc_patch/0001-CUDA-9.0-and-cuDNN-7.0-support.patch)\r\n- [eigen.f3a22f35b044.cuda9.diff](https://storage.googleapis.com/tf-performance/public/cuda9rc_patch/eigen.f3a22f35b044.cuda9.diff)\r\n\r\n2. Clone the tensorflow repo\r\n```https://github.com/tensorflow/tensorflow.git```\r\n\r\n3. Checkout the revision that the TensorFlow patch can apply to:\r\n```git checkout db596594b5653b43fcb558a4753b39904bb62cbd~```\r\n\r\n4. Apply the TensorFlow patch:\r\n```git apply ~/Downloads/0001-CUDA-9.0-and-cuDNN-7.0-support.patch```\r\n\r\n5. Run ./configure. When it asks for the CUDA version, put 9.0. When it asks for the cudnn version, put 7.0.1 (Entering '7' worked fine for me). Make sure you put the paths to the right Cuda and cudnn versions and have your ldconfig or LD_LIBARY_PATH set to point to the CUDA 9 folder.\r\n```./configure```\r\n\r\n6. Attempt to build TensorFlow, so that Eigen is downloaded. **This build will fail.**\r\n ```bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package```\r\n\r\n7. Apply the Eigen patch:\r\n```bash\r\n    cd -P bazel-out/../../../external/eigen_archive\r\n    patch -p1 < ~/Downloads/eigen.f3a22f35b044.cuda9.diff\r\n```\r\n\r\n8. Build TensorFlow successfully\r\n```bash\r\n    cd -\r\n    bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package\r\n```\r\n\r\nI have run this process myself on Ubuntu 14.04 with Python 2.7.\r\n\r\nThank for NVIDIA for the early patch and @reedwm who created most of these instructions.  \r\n\r\nIf you are using Python 2.7 and gcc 4.8+ here is a [.whl](https://storage.googleapis.com/tf-performance/tf_binary/gcc4_8/tensorflow-1.4.HEAD.b9ac2d7eb.AUG_1.CUDA9rc-cp27-none-linux_x86_64.whl) where I followed the instructions above and [one with CUDA 8 and cuDNN 7](https://storage.googleapis.com/tf-performance/tf_binary/gcc4_8/tensorflow-1.4.HEAD.b9ac2d7eb.AUG_1.CUDA8_cuDNN7-cp27-none-linux_x86_64.whl) which I have yet to test.  Stress again, this was created by me and not the TensorFlow build team.  My/our goal is to engage with anyone that wants to try this out and try to have a little fun.  :-)\r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/323926012","html_url":"https://github.com/tensorflow/tensorflow/issues/12474#issuecomment-323926012","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/12474","id":323926012,"user":{"login":"tanmayb123","id":9329669,"avatar_url":"https://avatars2.githubusercontent.com/u/9329669?v=4","gravatar_id":"","url":"https://api.github.com/users/tanmayb123","html_url":"https://github.com/tanmayb123","followers_url":"https://api.github.com/users/tanmayb123/followers","following_url":"https://api.github.com/users/tanmayb123/following{/other_user}","gists_url":"https://api.github.com/users/tanmayb123/gists{/gist_id}","starred_url":"https://api.github.com/users/tanmayb123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanmayb123/subscriptions","organizations_url":"https://api.github.com/users/tanmayb123/orgs","repos_url":"https://api.github.com/users/tanmayb123/repos","events_url":"https://api.github.com/users/tanmayb123/events{/privacy}","received_events_url":"https://api.github.com/users/tanmayb123/received_events","type":"User","site_admin":false},"created_at":"2017-08-22T05:51:23Z","updated_at":"2017-08-22T05:51:23Z","body":"Also, this is the specific build error I receive:\r\n```........\r\nERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': error loading package 'tensorflow/tools/pip_package': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):\r\n\tFile \"/home/tanmay/tensorflow/third_party/gpus/cuda_configure.bzl\", line 1039\r\n\t\t_create_local_cuda_repository(repository_ctx)\r\n\tFile \"/home/tanmay/tensorflow/third_party/gpus/cuda_configure.bzl\", line 976, in _create_local_cuda_repository\r\n\t\t_host_compiler_includes(repository_ctx, cc)\r\n\tFile \"/home/tanmay/tensorflow/third_party/gpus/cuda_configure.bzl\", line 145, in _host_compiler_includes\r\n\t\tget_cxx_inc_directories(repository_ctx, cc)\r\n\tFile \"/home/tanmay/tensorflow/third_party/gpus/cuda_configure.bzl\", line 120, in get_cxx_inc_directories\r\n\t\tset(includes_cpp)\r\ndepsets cannot contain mutable items\r\nWARNING: Target pattern parsing failed.\r\nERROR: error loading package 'tensorflow/tools/pip_package': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):\r\n\tFile \"/home/tanmay/tensorflow/third_party/gpus/cuda_configure.bzl\", line 1039\r\n\t\t_create_local_cuda_repository(repository_ctx)\r\n\tFile \"/home/tanmay/tensorflow/third_party/gpus/cuda_configure.bzl\", line 976, in _create_local_cuda_repository\r\n\t\t_host_compiler_includes(repository_ctx, cc)\r\n\tFile \"/home/tanmay/tensorflow/third_party/gpus/cuda_configure.bzl\", line 145, in _host_compiler_includes\r\n\t\tget_cxx_inc_directories(repository_ctx, cc)\r\n\tFile \"/home/tanmay/tensorflow/third_party/gpus/cuda_configure.bzl\", line 120, in get_cxx_inc_directories\r\n\t\tset(includes_cpp)\r\ndepsets cannot contain mutable items\r\nINFO: Elapsed time: 4.619s\r\nFAILED: Build did NOT complete successfully (0 packages loaded)\r\n    currently loading: tensorflow/tools/pip_package```"}}
{"actor":{"display_login":"tanmayb123"}}