I've always had an uneasy feeling with technology-based predictions 20+ years into the future. I remember my 300 watt desktop computer couldn't fluently playback this thing called "1080p HD". Less than a decade later, I've got this thing the size of a stack of coasters with a 5 volts 1.5 amps power adapter attached to my TV that can even play 4K content. Similarly I couldn't believe it when I read in a magazine in the early 2000's that soon Quake (pc game) would run on a phone! It was only for high-end desktop computers just years before.
Lastly, in the late '90s I read in a science magazine for kids the planned fusion reactor called ITER and I've been excited ever since. Unfortunately the project has been met with delays and the loss of interest by recent governments, but according to planning, first plasma is slated for 2025. I think when the need is extremely dire, more serious funding would go to serious solutions.
Speaking of serious solutions, generation IV nuclear fission reactors are a serious answer to the global energy problem. I can't believe we went through the first three dangerous generations of nuclear power, and now that the technology is finally maturing into a safe alternative, we've got green movements and populism (such as Angela Merkel closing 7 nuclear power plants in favor of burning more 'safe' coal, which even NASA agrees is just ill-considered) lobbying for an unfeasible solution to a massive problem.
Either way, 2040 is a scary time. If there is an energy crisis, it's because we chose it through feel-good policy.