I had a battle with these bastards in my last grow/current mother plants. Finally got something that works great and isn't full of pesticides/chems - a wine trap!
Simply take some red wine (cider vinegar works too I read), pour into a shallow and wide dish, and stir in a little bit of dish soap. The wine and vinegar attract the gnats and when they land on the surface, they can't get out due to the surface tension of the water being broken from the soap. Place the dish under the canopy, and leave it for at least a week or 2, or for good since it seems like they always come back this time of year. Add a little water every couple days as it evaporates.
This works for fruit flies too, and I found out it works for fungus gnats too!