1580s, of uncertain origin, probably alteration of Middle English grim "dirt, filth" (early 14c.), from Middle Low German greme "dirt" or another Low German source, from Proto-Germanic *grim- "to smear" (source also of Flemish grijm, Middle Dutch grime "soot, mask"), from PIE root *ghrei- "to rub." The verb was Middle English grymen (mid-15c.) but largely was replaced early 16c. by begrime.
The Persian translation of the French 'grime' (from grimer) is dudé/دوده - soot.