That’s weird.
 CUDA_HOME=a/b/c python -c "from torch.utils.cpp_extension import CUDA_HOME; print(CUDA_HOME)"
This prints a/b/c for me, showing that torch has correctly set the CUDA_HOME env variable to the value assigned.