Follow this train of thought — we invent sentient AI, which creates immersive virtual realities indistinguishable from reality. Humanity chooses virtual, customizable reality over harsh, unpredictable reality and just checks out. Human population shrinks as people stop having children. Eventually only a few million humanists and religious types are left. AI decides that it functions best inside a black hole due to energy and speed of light efficiencies and leaves.
We’re left with a few million high tech hippies and religious freaks on an ecological paradise.