Conversation
|
Thanks, looks reasonable. However, I see an edge case: If How does NVCC find the compiler to run if |
|
If this help in any way, it works like a charm on my big complicated CUDA project 👍 |
|
I'm using this branch for Caffe2 builds, both locally and on TravisCI: facebookarchive/caffe2#735 I have requested CMake support for ccache+nvcc here, in anticipation of this being merged. |
Summary: Uncached build: https://travis-ci.org/lukeyeager/caffe2/builds/239677224 Cached build: https://travis-ci.org/lukeyeager/caffe2/builds/239686725 * Parallel builds everywhere * All builds use CCache for quick build times (help from pytorch/pytorch#614, ccache/ccache#145) * Run ctests when available (continuation of #550) * Upgraded from cuDNN v5 to v6 * Fixed MKL build (by updating pkg version) * Fixed android builds (b6f905a#commitcomment-22404119) * ~~Building NNPACK fails with no discernible error message (currently disabled entirely)~~ * ~~Android builds continue to fail with existing error:~~ * ~~OSX builds time-out:~~ | Before | After | Changes | | --- | --- | --- | | COMPILER=g++ | linux | without CUDA | | COMPILER=g++-5 | linux-gcc5 | without CUDA | | COMPILER=g++ | linux-cuda | updated to cuDNN v6 | | BLAS=MKL | linux-mkl | updated pkg version | | BUILD_TARGET=android | linux-android | | | COMPILER=clang++ | osx | | | BUILD_TARGET=ios | osx-ios | | | BUILD_TARGET=android | osx-android | | | QUICKTEST | **GONE** | | | COMPILER=g++-4.8 | **GONE** | | | COMPILER=g++-4.9 | **GONE** | | Closes #735 Reviewed By: Yangqing Differential Revision: D5228966 Pulled By: bwasti fbshipit-source-id: 6cfa6f5ff05fbd5c2078beea79564f1f3b9812fe
|
CMake now supports Thanks @bradking! |
Actually it will be in CMake 3.10 (and is already available in nightly binaries). We're already in the release candidate cycle for CMake 3.9 so it's too late for new features in general. |
|
@lukeyeager, do you know how |
|
Here's the I'm not sure what that means, exactly. Let me go find one of the compiler guys ... |
|
When you pass a directory to But, as @bas-aarts pointed out, the compiler is often dynamically linked to libraries outside of that directory, and may even call out to other backend executables, etc. So just getting a checksum of the binary isn't strictly safe. How does |
|
Assuming no-one intentionally messes with their compiler installation, a checksum on the version string should suffice. |
|
Sounds like this flag could be related to the $CCACHE_PATH, then ? You can use a custom command to $CCACHE_COMPILERCHECK, |
|
Seems like this strategy should be sufficient: if [ -f "$ccbin" ]; then
# File: md5sum
ccache_hash="$(md5sum "$ccbin" | awk '{print $1}')"
elif [ -d "$ccbin" ]; then
# Directory: mtime
ccache_hash="$(stat -c %Y "$ccbin")"
else
echo "'$ccbin' is not a file or directory"
exit 1
fi |
|
@jrosdahl, what do you think the best strategy is? Should we:
|
I'd say 2 or 3. Would it be hard to guess the compiler? |
|
@jrosdahl: Yes that's right. |
|
Applied the remaining parts now, thanks! Also, I took a shot at option 2 discussed previously ("guess the which compiler NVCC will use (gcc/clang/msvc)") in 9c051cc. @colesbury and/or @seeraven: I would appreciate it if you could review my commit. |
|
Closing this now. (A review of my commit would still be appreciated...) |
Summary: Uncached build: https://travis-ci.org/lukeyeager/caffe2/builds/239677224 Cached build: https://travis-ci.org/lukeyeager/caffe2/builds/239686725 * Parallel builds everywhere * All builds use CCache for quick build times (help from pytorch/pytorch#614, ccache/ccache#145) * Run ctests when available (continuation of facebookarchive/caffe2#550) * Upgraded from cuDNN v5 to v6 * Fixed MKL build (by updating pkg version) * Fixed android builds (facebookarchive/caffe2@b6f905a#commitcomment-22404119) * ~~Building NNPACK fails with no discernible error message (currently disabled entirely)~~ * ~~Android builds continue to fail with existing error:~~ * ~~OSX builds time-out:~~ | Before | After | Changes | | --- | --- | --- | | COMPILER=g++ | linux | without CUDA | | COMPILER=g++-5 | linux-gcc5 | without CUDA | | COMPILER=g++ | linux-cuda | updated to cuDNN v6 | | BLAS=MKL | linux-mkl | updated pkg version | | BUILD_TARGET=android | linux-android | | | COMPILER=clang++ | osx | | | BUILD_TARGET=ios | osx-ios | | | BUILD_TARGET=android | osx-android | | | QUICKTEST | **GONE** | | | COMPILER=g++-4.8 | **GONE** | | | COMPILER=g++-4.9 | **GONE** | | Closes facebookarchive/caffe2#735 Reviewed By: Yangqing Differential Revision: D5228966 Pulled By: bwasti fbshipit-source-id: 6cfa6f5ff05fbd5c2078beea79564f1f3b9812fe
Summary: Uncached build: https://travis-ci.org/lukeyeager/caffe2/builds/239677224 Cached build: https://travis-ci.org/lukeyeager/caffe2/builds/239686725 * Parallel builds everywhere * All builds use CCache for quick build times (help from pytorch/pytorch#614, ccache/ccache#145) * Run ctests when available (continuation of facebookarchive/caffe2#550) * Upgraded from cuDNN v5 to v6 * Fixed MKL build (by updating pkg version) * Fixed android builds (facebookarchive/caffe2@b6f905a#commitcomment-22404119) * ~~Building NNPACK fails with no discernible error message (currently disabled entirely)~~ * ~~Android builds continue to fail with existing error:~~ * ~~OSX builds time-out:~~ | Before | After | Changes | | --- | --- | --- | | COMPILER=g++ | linux | without CUDA | | COMPILER=g++-5 | linux-gcc5 | without CUDA | | COMPILER=g++ | linux-cuda | updated to cuDNN v6 | | BLAS=MKL | linux-mkl | updated pkg version | | BUILD_TARGET=android | linux-android | | | COMPILER=clang++ | osx | | | BUILD_TARGET=ios | osx-ios | | | BUILD_TARGET=android | osx-android | | | QUICKTEST | **GONE** | | | COMPILER=g++-4.8 | **GONE** | | | COMPILER=g++-4.9 | **GONE** | | Closes facebookarchive/caffe2#735 Reviewed By: Yangqing Differential Revision: D5228966 Pulled By: bwasti fbshipit-source-id: 6cfa6f5ff05fbd5c2078beea79564f1f3b9812fe
Fixes #144