Mac Miller died Friday of an apparent overdose …

Law enforcement say… Mac was found Friday at around noon at his San Fernando Valley home and was pronounced dead at the scene.

We’re told authorities were alerted by a male who placed a 911 call, presumably from Mac’s home.

Miller has had trouble recently with substance abuse … in the wake of his breakup with Ariana Grande. The rapper wrecked his G-Wagon by wrapping it around a utility pole back in May and was arrested for DUI and hit and run. He fled the scene but cops say he later confessed at his home. He blew 2 times the legal limit.

Mac Miller’s final performance hours before he died: