{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vcpkg/issues/3609","repository_url":"https://api.github.com/repos/Microsoft/vcpkg","labels_url":"https://api.github.com/repos/Microsoft/vcpkg/issues/3609/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vcpkg/issues/3609/comments","events_url":"https://api.github.com/repos/Microsoft/vcpkg/issues/3609/events","html_url":"https://github.com/Microsoft/vcpkg/issues/3609","id":327264740,"node_id":"MDU6SXNzdWUzMjcyNjQ3NDA=","number":3609,"title":"vpkg pretends CUDA SDK is not installed, but it is.","user":{"login":"akors","id":3023492,"node_id":"MDQ6VXNlcjMwMjM0OTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3023492?v=4","gravatar_id":"","url":"https://api.github.com/users/akors","html_url":"https://github.com/akors","followers_url":"https://api.github.com/users/akors/followers","following_url":"https://api.github.com/users/akors/following{/other_user}","gists_url":"https://api.github.com/users/akors/gists{/gist_id}","starred_url":"https://api.github.com/users/akors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akors/subscriptions","organizations_url":"https://api.github.com/users/akors/orgs","repos_url":"https://api.github.com/users/akors/repos","events_url":"https://api.github.com/users/akors/events{/privacy}","received_events_url":"https://api.github.com/users/akors/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-05-29T10:42:11Z","updated_at":"2018-09-26T09:54:43Z","closed_at":null,"author_association":"NONE","body":"Hi, I have tried to install the CUDA SDK via vcpkg, but the installation failed:\r\n\r\n```\r\nCMake Error at vcpkg/ports/cuda/portfile.cmake:26 (message):\r\n  Could not find CUDA.  Before continuing, please download and install CUDA\r\n  (V9.0.0 or higher) from:\r\n\r\n      https://developer.nvidia.com/cuda-downloads\r\n\r\n\r\n\r\n  Also ensure vcpkg has been rebuilt with the latest version (v0.0.104 or\r\n  later)\r\nCall Stack (most recent call first):\r\n  vcpkg/scripts/ports.cmake:72 (include)\r\n\r\n\r\nError: Building package cuda:x86-windows failed with: BUILD_FAILED\r\n```\r\n\r\nThe thing is, I have the CUDA SDK installed in `C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0`. The toolkit is on the PATH (i can call nvcc just fine), and it is registered in the registry:\r\n\r\n`Computer\\HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\GPU Computing Toolkit\\CUDA\\v9.0`\r\n\r\nI don't really know why vcpkg thinks it's not there.\r\n\r\nWhat's notable is that I have two additional CUDA SDK's installed: v8.0 and v9.1. Is vcpkg maybe confused by that?\r\n\r\nUnfortunately I couldn't find any verbose switches or log files that I could attach.\r\n\r\nMy VCPKG version is: Vcpkg package management program version 0.0.113-nohash\r\nMy Windows version is: Windows 10 Pro version 1709"},"comment":{"url":"https://api.github.com/repos/Microsoft/vcpkg/issues/comments/424656524","html_url":"https://github.com/Microsoft/vcpkg/issues/3609#issuecomment-424656524","issue_url":"https://api.github.com/repos/Microsoft/vcpkg/issues/3609","id":424656524,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDY1NjUyNA==","user":{"login":"leilaShen","id":22429600,"node_id":"MDQ6VXNlcjIyNDI5NjAw","avatar_url":"https://avatars3.githubusercontent.com/u/22429600?v=4","gravatar_id":"","url":"https://api.github.com/users/leilaShen","html_url":"https://github.com/leilaShen","followers_url":"https://api.github.com/users/leilaShen/followers","following_url":"https://api.github.com/users/leilaShen/following{/other_user}","gists_url":"https://api.github.com/users/leilaShen/gists{/gist_id}","starred_url":"https://api.github.com/users/leilaShen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leilaShen/subscriptions","organizations_url":"https://api.github.com/users/leilaShen/orgs","repos_url":"https://api.github.com/users/leilaShen/repos","events_url":"https://api.github.com/users/leilaShen/events{/privacy}","received_events_url":"https://api.github.com/users/leilaShen/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T09:54:43Z","updated_at":"2018-09-26T09:54:43Z","author_association":"NONE","body":"> So I figured out the problem, and it seems to be a change in vcpkg behaviour since the CUDA port file was written.\r\n> \r\n> Here is what the port file tries to do:\r\n> \r\n> ```cmake\r\n> find_program(NVCC\r\n>     NAMES nvcc nvcc.exe\r\n>     PATHS\r\n>       ENV CUDA_PATH\r\n>       ENV CUDA_BIN_PATH\r\n>     PATH_SUFFIXES bin bin64\r\n>     DOC \"Toolkit location.\"\r\n>     NO_DEFAULT_PATH\r\n>     )\r\n> ```\r\n> \r\n> It looks in the environment variables `CUDA_PATH`, `CUDA_BIN_PATH` and in some CMake default locations, like in the `PATH` environment variable.\r\n> \r\n> This is nice and all, but apparently vcpkg goes out of its way to delete all environment variables and reset them to some minimal values, presumably for a \"clean build environment\". So vcpkg cleans the environment so well that the port can't ever work, because no environment variables that could contain the CUDA path ever reach the portfile.\r\n> \r\n> I don't know what the solution is, but I'm pinging @ras0219-msft and @jasjuang because they seem to be the ones responsible for the CUDA port.\r\n> \r\n> In the mean time, I suggest the following workaround for my fellow users:\r\n> Just hardcode the CUDA path in the portfile, by adding this:\r\n> \r\n> ```cmake\r\n> set(ENV{CUDA_BIN_PATH} \"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/bin\")\r\n> ```\r\n> \r\n> To the top of the file `ports\\cuda\\portfile.cmake`\r\n\r\nThis works for me. Thanks a lot!"}}
{"actor":{"display_login":"leilaShen"}}