X-ray diffractometry and X-ray scattering reciprocal space maps have been used to study strain relaxation in a complex buffer composed of seven intermediate layers of AlxGa1 − xN composition with different values of x, decreasing with an increase in the distance from the substrate. The layers have been grown by hydride metalorganic vapor phase epitaxy on silicon and sapphire substrates. Differences in the structural quality of the first four layers of a multilayer buffer grown on different substrates have been revealed. A gradual smoothing out of these differences in the next three layers with an increase in the layer serial number has been shown. The last grown intermediate AlxGa1 − xN layer and the GaN layer grown on it have identical thicknesses and degrees of mosaicity, regardless of the substrate type. Device structures grown on a complex buffer demonstrate emission in approximately the same wavelength range.