Catalyzes the conversion of D-ribulose 5-phosphate to formate and 3,4-dihydroxy-2-butanone 4-phosphate. Catalyzes the conversion of GTP to 2,5-diamino-6-ribosylamino-4(3H)-pyrimidinone 5'-phosphate (DARP), formate and pyrophosphate. D-ribulose 5-phosphate = (2S)-2-hydroxy-3-oxobutyl phosphate + formate + H(+) GTP + 4 H2O = 2,5-diamino-6-hydroxy-4-(5-phosphoribosylamino)-pyrimidine + formate + 3 H(+) + 2 phosphate Binds 2 divalent metal cations per subunit. Magnesium or manganese. Binds 1 zinc ion per subunit. Cofactor biosynthesis; riboflavin biosynthesis; 2-hydroxy-3-oxobutyl phosphate from D-ribulose 5-phosphate: step 1/1. Cofactor biosynthesis; riboflavin biosynthesis; 5-amino-6-(D-ribitylamino)uracil from GTP: step 1/4. In the N-terminal section; belongs to the DHBP synthase family. In the C-terminal section; belongs to the GTP cyclohydrolase II family.