Fix the warning if the wrong gcc is used with nvcc (#20158)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/11886
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20158
Differential Revision: D15217665
Pulled By: ezyang
fbshipit-source-id: 951bb640cc8bea705cb2f39ca2024e3c5084cd3b