EXCLUSIVE

Suge Knight made a death threat against famed "Straight Outta Compton" director F. Gary Gray ... so claims the L.A. County Grand Jury which indicted Suge on felony criminal threats ... TMZ has learned.

We've learned Suge allegedly made the threat during the filming of the movie, but months before he killed a man involved in the production by driving over him in a Compton parking lot.

TMZ has obtained a copy of the Grand Jury indictment, which reads in part, "On or about August 8, 2014, Suge ... threatened to commit a crime which would result in death and great bodily injury to Felix Gary Gray."

Suge was extremely unhappy with his portrayal in the movie and we're told he sent the threat by text.

Suge is scheduled to be arraigned on the charge Thursday.

Here's the weird thing ... the indictment is dated February 7, 2017. It's unclear why it took 6 months to arraign him.