The actor who plays temperamental chef Artie Bucco on "The Sopranos" avoided jail time for driving while impaired in a plea bargain deal, authorities said.

John Ventimiglia, 42, who portrays Tony Soprano's high school buddy on the HBO show, will visit 30 schools to caution against drinking and driving under the agreement announced Monday in a Brooklyn courtroom.

Ventimiglia will also lose his license for 90 days and pay a $500 fine, among other conditions.

He was arraigned May 1 on drunken driving, drug possession and other charges after officers spotted him weaving in and out of traffic. The plea to driving while impaired settled all the charges against him.

A criminal complaint alleged that when police pulled him over, the actor had bloodshot eyes, slurred speech and smelled of alcohol.

Ventimiglia's blood-alcohol content was 0.12 -- the legal limit is 0.08 -- and he was carrying a zip-lock bag with cocaine residue, according to the complaint.