Hindu references to ethogenics(drugs imbibed for spiritual purposes) include the Kesin hymn, where the long haired ascetics wearing yellow, would ingest the poisonous drug, but through yoga become immortal from drinking Rudras poisonous elixer.

This validated not only in the Rig-Veda but in Shiva legends as well. One includes Shiva(the ultimate yogi) drinking the necter out of the sky, a necter which proved poisonous to the devas and the asuras. That's why Shiva has a blue throat, its a toxic side effect of the amrita he consumed.

The nath yogis who invented hath a yoga, also took psychedelics like ganja, and jimson weed, and others unknown.
It is also widely accepted by many shivites that Ganja drinks like bhang is the legendary soma mentioned by the rishis