Skip to content

Commit

Permalink
[Cuda][Codegen] Check for cuda include dir in /usr/include. (#8135)
Browse files Browse the repository at this point in the history
Currently, on linux platforms, only checks for cuda install directory
in /usr/local/cuda/include.  The `nvidia-cuda-dev` package of Ubuntu
20.04 installs at /usr/include, so it would be good to check that
location as well.

Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
  • Loading branch information
Lunderberg and Lunderberg authored May 26, 2021
1 parent 23a95f6 commit 95f71f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/target/opt/build_cuda_on.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ std::string FindCUDAIncludePath() {
if (stat(cuda_include_path.c_str(), &st) == 0) {
return cuda_include_path;
}

if (stat("/usr/include/cuda.h", &st) == 0) {
return "/usr/include";
}
#endif
LOG(FATAL) << "Cannot find cuda include path."
<< "CUDA_PATH is not set or CUDA is not installed in the default installation path."
Expand Down

0 comments on commit 95f71f9

Please sign in to comment.