We investigate global instability and vortex shedding in the separated laminar boundary layer beneath internal solitary waves (ISWs) of depression in a two-layer stratified fluid by performing high-resolution two-dimensional direct numerical simulations. The simulations were conducted with waves propagating over a flat bottom and shoaling over relatively mild and steep slopes. Over a flat bottom, the potential for vortex shedding is shown to be directly dependent on wave amplitude, for a particular stratification, owing to increase of the adverse pressure gradient ( for leftward propagating waves) beneath the trailing edge of larger amplitude waves. The generated eddies can ascend from the bottom boundary to as high as 33 % of the total depth in two-dimensional simulations. Over sloping boundaries, global instability occurs beneath all waves as they steepen. For the slopes considered, vortex shedding begins before wave breaking and the vortices, shed from the bottom boundary, can reach the pycnocline, modifying the wave breaking mechanism. Combining the results over flat and sloping boundaries, a unified criterion for vortex shedding in arbitrary two-layer continuous stratifications is proposed, which depends on the momentum-thickness Reynolds number and the non-dimensionalized ISW-induced pressure gradient at the point of separation. The criterion is generalized to a form that may be readily computed from field data and compared to published laboratory experiments and field observations. During vortex shedding events, the bed shear stress, vertical velocity and near-bed Reynolds stress were elevated, in agreement with laboratory observations during re-suspension events, indicating that boundary layer instability is an important mechanism leading to sediment re-suspension.