{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/2075","repository_url":"https://api.github.com/repos/bazelbuild/bazel","labels_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2075/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2075/comments","events_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2075/events","html_url":"https://github.com/bazelbuild/bazel/issues/2075","id":188727610,"number":2075,"title":"Add CUDA compiler support on Windows","user":{"login":"meteorcloudy","id":4171702,"avatar_url":"https://avatars2.githubusercontent.com/u/4171702?v=4","gravatar_id":"","url":"https://api.github.com/users/meteorcloudy","html_url":"https://github.com/meteorcloudy","followers_url":"https://api.github.com/users/meteorcloudy/followers","following_url":"https://api.github.com/users/meteorcloudy/following{/other_user}","gists_url":"https://api.github.com/users/meteorcloudy/gists{/gist_id}","starred_url":"https://api.github.com/users/meteorcloudy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteorcloudy/subscriptions","organizations_url":"https://api.github.com/users/meteorcloudy/orgs","repos_url":"https://api.github.com/users/meteorcloudy/repos","events_url":"https://api.github.com/users/meteorcloudy/events{/privacy}","received_events_url":"https://api.github.com/users/meteorcloudy/received_events","type":"User","site_admin":false},"labels":[{"id":328197556,"url":"https://api.github.com/repos/bazelbuild/bazel/labels/category:%20multi-platform%20%3E%20windows","name":"category: multi-platform > windows","color":"d4c5f9","default":false},{"id":192364831,"url":"https://api.github.com/repos/bazelbuild/bazel/labels/P0","name":"P0","color":"b60205","default":false},{"id":356757428,"url":"https://api.github.com/repos/bazelbuild/bazel/labels/Release%20blocker","name":"Release blocker","color":"b60205","default":false}],"state":"closed","locked":false,"assignee":{"login":"meteorcloudy","id":4171702,"avatar_url":"https://avatars2.githubusercontent.com/u/4171702?v=4","gravatar_id":"","url":"https://api.github.com/users/meteorcloudy","html_url":"https://github.com/meteorcloudy","followers_url":"https://api.github.com/users/meteorcloudy/followers","following_url":"https://api.github.com/users/meteorcloudy/following{/other_user}","gists_url":"https://api.github.com/users/meteorcloudy/gists{/gist_id}","starred_url":"https://api.github.com/users/meteorcloudy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteorcloudy/subscriptions","organizations_url":"https://api.github.com/users/meteorcloudy/orgs","repos_url":"https://api.github.com/users/meteorcloudy/repos","events_url":"https://api.github.com/users/meteorcloudy/events{/privacy}","received_events_url":"https://api.github.com/users/meteorcloudy/received_events","type":"User","site_admin":false},"assignees":[{"login":"meteorcloudy","id":4171702,"avatar_url":"https://avatars2.githubusercontent.com/u/4171702?v=4","gravatar_id":"","url":"https://api.github.com/users/meteorcloudy","html_url":"https://github.com/meteorcloudy","followers_url":"https://api.github.com/users/meteorcloudy/followers","following_url":"https://api.github.com/users/meteorcloudy/following{/other_user}","gists_url":"https://api.github.com/users/meteorcloudy/gists{/gist_id}","starred_url":"https://api.github.com/users/meteorcloudy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteorcloudy/subscriptions","organizations_url":"https://api.github.com/users/meteorcloudy/orgs","repos_url":"https://api.github.com/users/meteorcloudy/repos","events_url":"https://api.github.com/users/meteorcloudy/events{/privacy}","received_events_url":"https://api.github.com/users/meteorcloudy/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2016-11-11T10:15:22Z","updated_at":"2017-08-28T07:16:42Z","closed_at":"2016-11-22T18:16:08Z","body":"On unix platform, for GPU build, TF is using the crosstool under https://github.com/tensorflow/tensorflow/tree/master/third_party/gpus/crosstool.\r\nNVCC is invoked by this python script https://github.com/tensorflow/tensorflow/blob/master/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl\r\n\r\nThe script can recognize it's a cuda compilation if `-x cuda` is in the compile options and then construct a proper command line for nvcc.\r\n\r\nI am basically adding the same logic into Bazel's MSVC python wrapper script [msvc_tools.py](https://github.com/bazelbuild/bazel/blob/master/tools/cpp/wrapper/bin/pydir/msvc_tools.py.tpl).\r\nIt is definitely not the most ideal solution, but I managed to make it work.\r\n\r\nWith some other changes, the latest progress is I can build the pip package with GPU support, but it crashed when I do `import tensorflow as tf`\r\n```\r\nC:\\Windows\\system32>python\r\nPython 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import tensorflow as tf\r\nTraceback (most recent call last):\r\n  File \"C:\\Program Files\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\__init__.py\", line 54, in <module>\r\n    from tensorflow.python import pywrap_tensorflow\r\n  File \"C:\\Program Files\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow.py\", line 28, in <module>\r\n    _pywrap_tensorflow = swig_import_helper()\r\n  File \"C:\\Program Files\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow.py\", line 24, in swig_import_helper\r\n    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)\r\n  File \"C:\\Program Files\\Anaconda3\\lib\\imp.py\", line 242, in load_module\r\n    return load_dynamic(name, filename, file)\r\n  File \"C:\\Program Files\\Anaconda3\\lib\\imp.py\", line 342, in load_dynamic\r\n    return _load(spec)\r\nImportError: DLL load failed: Invalid access to memory location.\r\n\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\n```\r\n\r\nI also tried to build the C++ example trainer, it also crash during runtime.\r\n\r\nIt might be some linking problem, but I have no clue yet. I'll keep investigating this.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/comments/325278603","html_url":"https://github.com/bazelbuild/bazel/issues/2075#issuecomment-325278603","issue_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2075","id":325278603,"user":{"login":"meteorcloudy","id":4171702,"avatar_url":"https://avatars2.githubusercontent.com/u/4171702?v=4","gravatar_id":"","url":"https://api.github.com/users/meteorcloudy","html_url":"https://github.com/meteorcloudy","followers_url":"https://api.github.com/users/meteorcloudy/followers","following_url":"https://api.github.com/users/meteorcloudy/following{/other_user}","gists_url":"https://api.github.com/users/meteorcloudy/gists{/gist_id}","starred_url":"https://api.github.com/users/meteorcloudy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteorcloudy/subscriptions","organizations_url":"https://api.github.com/users/meteorcloudy/orgs","repos_url":"https://api.github.com/users/meteorcloudy/repos","events_url":"https://api.github.com/users/meteorcloudy/events{/privacy}","received_events_url":"https://api.github.com/users/meteorcloudy/received_events","type":"User","site_admin":false},"created_at":"2017-08-28T07:16:42Z","updated_at":"2017-08-28T07:16:42Z","body":"@snnn No, because we have to construct arguments for nvcc compler, even the linux Cuda CROSSTOOL uses a wrapper script. See https://github.com/tensorflow/tensorflow/blob/master/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl"}}
{"actor":{"display_login":"meteorcloudy"}}