"knotted and rugged," c. 1600, from gnarl (see gnarled) + -y (2). Picked up 1970s as surfer slang to describe a dangerous wave; it had spread to teen slang by 1982, where it meant both "excellent" and "disgusting."
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].
adjective suffix, "full of or characterized by," from Old English -ig, from Proto-Germanic *-iga- (source also of Dutch, Danish, German -ig, Gothic -egs), from PIE -(i)ko-, adjectival suffix, cognate with elements in Greek -ikos, Latin -icus (see -ic). Originally added to nouns in Old English; used from 13c. with verbs, and by 15c. even with other adjectives (for example crispy).
Others are reading
<a href="https://www.etymonline.com/word/gnarly">Etymology of gnarly by etymonline</a>
Harper, D. (n.d.). Etymology of gnarly. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/gnarly