Since libmfx does not support dynamic sizing of frame pools, extra_hw_frames is needed to set how many frames will be available in the pool created by hwupload which is then used at the encoder input. Setting a high lookahead depth means the encoder will consume a large number of frames without returning them, so if extra_hw_frames is not large enough the pool will be exhausted as indicated by the error message above.

Set extra_hw_frames to reflect how many frames you actually intend to use. With a lookahead depth of 100 you need at least 100, and probably more because the encoder will also store past frames to use for reference.