Turin professors first connected Gramsci to socialist thought.

Evidence

Foremost among these were Umberto Cosmo, a literary historian and Dante scholar, with whom Gramsci became friends and whom he subsequently was to criticise for his bourgeois style of attachment to the workers’ movement, and Annibale Pastore, whose lectures on Marxism Gramsci attended. — Antonio Gramsci, Selections from the Prison Notebooks, 44