the source of the group of words that includes gnarl (v.), gnarl (n.), gnarly is Shakespeare's use of gnarled in 1603:
Thy sharpe and sulpherous bolt Splits the vn-wedgable and gnarled Oke. ["Measure for Measure," II.ii.116]OED and Barnhart call it a variant of knurled, from Middle English knar "knot in wood" (late 14c.), originally "a rock, a stone;" of uncertain origin. "(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].
"contort, twist," 1814, a back-formation from gnarled. As a noun from 1824. Earlier the verb was used in a sense of "to snarl" (1590s).