Nonlinear instability in a supersonic boundary layer at Mach 4.8 with two-dimensional roughness is investigated by means of spatial direct numerical simulations (DNS). It was previously found that an important effect of a two-dimensional roughness is to increase significantly the amplitude of two-dimensional waves downstream of the roughness in a certain frequency band through enhanced instability and transient growth, while waves outside this band are damped. Here, we investigate the nonlinear secondary instability induced by a large-amplitude two-dimensional wave, which has received a significant boost in amplitude from this additional roughness-induced amplification. Both subharmonic and fundamental secondary excitation of the oblique secondary waves are considered. We found that even though the growth rate of the secondary perturbations increases compared to their linear amplification, only in some of the cases was a fully resonant state attained by the streamwise end of the domain. A parametric investigation of the amplitude of the primary wave, the phase difference between the primary and the secondary waves, and the spanwise wavenumber has also been performed. The transient growth experienced by the primary wave was found to not influence the secondary instability for most parameter combinations. For unfavourable phase relations between the primary and the secondary waves, the phase speed of the secondary wave decreases significantly, and this hampers its growth. Finally, we also investigated the strongly nonlinear stage, for which both the primary and the subharmonic secondary waves had a comparable, finite amplitude. In this case, the growth of the primary waves was found to vanish downstream of the transient growth region, resulting in a lower amplitude than in the absence of the large-amplitude secondary wave. This feedback also decreases the amplification rate of the secondary wave.