In this work, we derive a closed-form criterion for the onset of cavitation in compressible, isotropic, hyperelastic solids subjected to non-symmetric loading conditions. The criterion is based on the solution of a boundary value problem where a hyperelastic solid, which is infinite in extent and contains a single vacuous inhomogeneity, is subjected to uniform displacement boundary conditions. By making use of the "linear-comparison" variational procedure of Lopez-Pamies and Ponte Castañeda (J. Mech. Phys. Solids 54:807-830, 2006), we solve this problem approximately and generate variational estimates for the critical stretches applied on the boundary at which the cavity suddenly starts growing. The accuracy of the proposed analytical result is assessed by comparisons with exact solutions available from the literature for radially symmetric cavitation, as well as with finite element simulations. In addition, applications are presented for a variety of materials of practical and theoretical interest, including the harmonic, Blatz-Ko, and compressible Neo-Hookean materials.