The only scenario I can imagine where underground habitats won't cut it is if we turn the Earth into another Venus. In that case the heat would eventually cook the underground habitats and kill everyone off. While global warming is by most accounts as bad or worse than the worst predictions thus far, we aren't quite to the absolute out of control greenhouse effect of Venus.