From 45ec4920e32d1422342148afedf3254675a7e5d7 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Tue, 26 Mar 2019 19:56:39 -0700 Subject: [PATCH] how to use the `ccache` package on Ubuntu (#18495) Summary: Added full instructions for how to use the `ccache` package. Thanks. Pull Request resolved: https://github.com/pytorch/pytorch/pull/18495 Differential Revision: D14635351 Pulled By: ezyang fbshipit-source-id: 158e1052bae580e95f73644252fdbddcc0213128 --- CONTRIBUTING.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b7ec5d..25372f1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -319,6 +319,27 @@ be on your `PATH`, otherwise `ccache` will emit the following error: ccache: error: Could not find compiler "nvcc" in PATH +For example, here is how to install/configure `ccache` on Ubuntu: + +```bash +# install ccache +sudo apt install ccache + +# update symlinks and create/re-create nvcc link +sudo /usr/sbin/update-ccache-symlinks +sudo ln -s /usr/bin/ccache /usr/lib/ccache/nvcc + +# config: cache dir is ~/.ccache, conf file ~/.ccache/ccache.conf +# max size of cache +ccache -M 25Gi # -M 0 for unlimited +# unlimited number of files +ccache -F 0 + +# deploy (and add to ~/.bashrc for later) +export PATH="/usr/lib/ccache:$PATH" +export CUDA_NVCC_EXECUTABLE=/usr/lib/ccache/nvcc +``` + ## CUDA Development tips If you are working on the CUDA code, here are some useful CUDA debugging tips: -- 2.7.4