c. 1600, probably a variant of knurled, from Middle English knar "knob, knot in wood, protruding mass on a tree" (late 14c.), earlier "a crag, rugged rock or stone" (early 13c.), from a general group of Germanic words that includes English knob, knock, knuckle, knoll, knurl. Gnarl (v.) "make knotty," gnarl (n.) "a knotty growth on wood," and gnarly (adj.) all seem to owe their existence in modern English to Shakespeare's use of gnarled in 1603:
[T]hy sharpe and sulpherous bolt Splits the vn-wedgable and gnarled Oke. ["Measure for Measure," II.ii.116]
"(Gnarled) occurs in one passage of Shakes. (for which the sole authority is the folio of 1623), whence it came into general use in the nineteenth century" [OED].