Once upon a time there was an env variable that you could set to add additional flags to nvcc. Now it looks like all extra flags are added directly in aten/CMakeLists.txt, e.g. https://github.com/pytorch/pytorch/blob/master/aten/CMakeLists.txt#L73 88