In addition to the fossil fuels that powered Song China and the Industrial Revolution, Earth has stored an even larger amount of energy as "fossil heat": heat that has been produced in the crust by crustal radioactivity over its 4.6-billion-year lifespan (so far) that has not yet had time to escape to the surface. Additionally, an even larger amount of heat energy is stored in the mantle and core from Earth's initial formation, produced by the gravitational potential energy of the matter that formed it.
This fossil geothermal energy, if extracted at an unsustainable rate, could provide orders of magnitude more power than combustible fossil fuels ever have; moreover, exploiting it would release no carbon dioxide, only heat.
Currently photovoltaic power is so inexpensive (€0.17 per peak watt, working out to about €0.85 per average watt at a typical 20% capacity factor) that it is uneconomic to build heat engines to produce power, whether to harness heat from fossil fuels, from nuclear energy, from solar concentrators, or from such geothermal sources. If new manufacturing technology or new heat-engine designs can reduce the cost of heat engines to below the cost of PV cells, it could enable the exploitation of this fossil energy. Otherwise, it is unlikely to happen before most of Earth's insolation is being converted to electricity.
There is probably no profit or economic incentive to go underground other than as a temporary measure. However, it would provide a measure of security against potential global disasters such as comet strikes, Carrington-class events, global totalitarian dictatorships, global thermonuclear war, pandemics worse than covid, and the like; whatever could survive independently underground would be relatively safe from such events.
Historically, geothermal energy has only been available in hotspots with existing water reservoirs. So-called "hot dry rock" or "enhanced geothermal systems" geothermal involves hydrofracking of deep crustal rock and pumping water through it; this can be done anywhere on Earth.
To give round numbers, the whole mantle is at 1000° or more, has a specific heat of about 0.7 J/g/K, and weighs about 4 × 10²⁴ kg; this amounts to a thermal energy of some 2.8 × 10³⁰ J relative to the temperature at the surface, and so perhaps 1.1 × 10³⁰ J of energy practically extractable at 40% Carnot efficiency. (In fact, the innermost part of the mantle is closer to 3700°, so this is a conservative estimate.) If extracted over 1000 years, this would amount to 35 exawatts. By contrast, total terrestrial insolation at the usual standard "solar constant" of 1000 W/m² is only 0.13 exawatts, about 250 times smaller.
(The specific heat of the mantle is fairly uncertain. The work I've been able to find suggests that the specific heat of CaTiO₃ perovskite is in the neighborhood of 0.5 to 1.0 J/g/K depending on temperature, while CaSiO₃ [calcium metasilicate] and MgSiO₃ perovskites, which compose much of the mantle, have a heat capacity in the range of 75–125 J/mol/K. I figure calcium is 40, magnesium is 24, silicon is 28, and oxygen is 16, so those are 100–116 g/mol, which is in the range of 0.7 to 1.25 J/g/K. Regardless, most things have a specific heat of around 1 J/g/K, water being a bit of an outlier at almost 4.2, and heavy monatomic gases like xenon being a bit of an outlier in the opposite direction at about 0.1.)
A heat engine requires a hot reservoir and a cold reservoir, but the cold reservoir need not be the surface of Earth; a larger volume of rock at a shallower depth would also suffice.
So a subterranean civilization, if it existed, could reach Kardashev Level 1 without going above the surface. But could it exist?
The humans' survival has a number of prerequisites other than energy. They need cool, oxygen, nutritional compounds, gravity, water, quiet, sleep, love, beauty, a sense of purpose, a relatively chemically inert environment (lacking, for example, hydrogen sulfide or chlorine), waste disposal, space, low pressure, and probably light.
XXX restructure this part
They can only directly harness energy provided chemically, the most practical form of which is to grow plants, which need most of the same things, also provide nutritional compounds, and definitely do need light.
Cool can be provided in an underground chamber by insulating and refrigerating it, pumping the heat into a cold reservoir elsewhere. Oxygen can be extracted electrolytically from oxygen-containing rocks, which is most of them. Gravity is unavoidable on or in Earth. Water is abundant in the crust down to at least several kilometers; the Kola Superdeep Borehole found that in that location hydrogen was abundant even deeper than that, although perhaps that suggests that oxygen wasn't. Quiet is the default state underground, though soundproofing might be needed in the vicinity of heavy machinery. Sleep, love, beauty, and a sense of purpose can be constructed by the humans themselves. A chemically inert environment might use nitrogen, which is relatively scarce underground, or helium, which is abundant.
Space can be provided by producing oxygen from oxygen-containing rocks, as described earlier, and pumping it closer to the surface. The oxygen will either oxidize other rocks, if there are any nearby that aren't already fully oxidized, or bubble to the surface harmlessly. The reduced rocks will occupy less space than the original rocks. Alternatively, if there is access to the surface, spoil can be pushed to the surface, and especially at shallow depths it may be possible to uplift an area of land to create space beneath it — the reverse of the subsidence often associated with, for example, brine-based salt mining.
(Neal Stephenson explored this theme fictionally in his novel Seveneves, in which he posited that space underground could not be expanded, so his hypothetical underground civilization had to make do with the space that had already been excavated before the disaster the novel is built around.)
Waste can be disposed of by recycling, which is mostly a matter of separating wastes of unknown composition into their ingredients, or by isolation, which is mostly a matter of keeping wastes of dangerous composition away from the humans and their equipment, consuming space. Aboveground there is no shortage of space; belowground, generally whatever material is used must first be mined. If the waste can be melted into fully dense solids, it need occupy no more space than the original rocks from which it was mined, but that might turn out to be more difficult than just making more space to store looser waste in.
Low pressure is scarce underground, and the details depend on the circumstances, but it can generally be provided by supporting the rock above a cavern with materials of greater compressive strength than the other rocks. If they have 10% more compressive strength, they enable you to fill 9% of the space with air; if twice the compressive strength, half; if ten times the compressive strength, 90%; and so on. Salt poses special problems, as it tends to flow horizontally back into open spaces, but this takes decades or centuries; other rocks will behave similarly at sufficiently high temperatures.
Light, air purification, food cultivation, air conditioning, cooling, oxygen production, and rock electrolysis will all consume energy and require specialized equipment.
Much of the above calculation of geothermal energy abundance isn't concerned with current technological limitations, but with the ultimate limitations. What's accessible within current limitations?
The amount of thermal energy in the crust is considerably smaller than the amount in Earth as a whole; the temperature at the Moho crust–mantle boundary ranges from 200° to 400°, and the crust is only some 1% of Earth's mass, so we're talking about maybe 10²⁸ J in the crust. So far, despite 63 years of effort, the humans have not been able to drill into the mantle; the Kola Superdeep Borehole ("Кольская сверхглубокая скважин") only reached 12.3 km of drilling depth before being doomed by the 180° temperature found there and the collapse of the USSR. (The crust is typically 30–50 km thick on continents, 5–10 km thick in the ocean.) The KTB superdeep borehole persevered until reaching 260° at only 9.1 km of depth. These temperatures are suboptimal for driving heat engines, since water's critical point is 374° and 22 MPa, but nevertheless clearly quite feasible.
Suppose we can routinely access the top 11 km of continental crust, and that it's routinely 210°, in between the Kola numbers (14 km, 180°) and the KTB numbers (9 km, 260°), and that temperature increases linearly from here to there, which is conservative. Ocean covers 71% of Earth, so the continents are about 148 million km², 1.48 × 10¹⁴ m². Rock is about 2.4 g/cc so these top 11 km are about 3.9 × 10¹⁸ tonnes of rock. If it were all 210° and 0.7 J/g/K, the thermal energy to drop it to 20° would be 5.2 × 10²⁶ J, so a linear increase gives you half that, 2.6 × 10²⁶ J. Rather than actually calculating the Carnot efficiency, I'll just assume it's about 25%, giving 6.5 × 10²⁵ J electric. If that were to be extracted over the next century, it would yield almost 21 petawatts, electric, or 620 000 "quadrillion BTU per year" (electric) or 180 million terawatt hours (electric) per year, in the medieval units used by the IEA.
XXX https://en.wikipedia.org/wiki/World_energy_consumption say 18 terawatts. That means this is not "about twice world marketed energy consumption" but rather about 1200 times. Also usually geothermal people only consider the top 6 km reasonably usable with modern technology. FEEX
This is about twice current world marketed energy consumption, but that doesn't include sunlight on fields, which a purely subterranean civilization would need to include.
This should be sufficient to develop technology for deeper drilling and/or Dyson-sphere construction.
It's plausible that the amount of available energy with current technology is a few times larger than this, because the above does not take hotspots and tectonically active zones into account, nor the ocean floor.
Enhanced geothermal systems projects in Pohang and Basel have been canceled after causing earthquakes locally; in Pohang no humans died but more than a hundred were injured, though in both places the earthquakes were fairly minor. We can expect that widespread use of EGS would produce widespread minor earthquakes, even as it depletes the source of energy that drives volcanism and seismic activity.
Even if it does not pose a risk to surface civilization, for example because of being located far from surface cities, this induced seismicity would be clearly detectable from the surface, while the tunnels and increased oxygen emissions probably would not. In places with little natural seismic activity, it would be more conspicuous than in places with a great deal.