A density functional theory is used to investigate the instability arising in superfluid $^4$He as it flows at velocity u just above the Landau critical velocity of rotons v_c. Confirming an early theoretical prediction by one of us [JETP Lett. 39, 511 (1984)], we find that a stationary periodic modulation of the density occurs, with amplitude proportional to (u-v_c)^{1/2} and wave vector equal to the roton wave vector. This density pattern is studied for supercritical flow both in bulk helium and in a channel of nanometer cross-section.