While some small studies have suggested that recreational marijuana use may lead to ED.

Smoking tobacco restricts blood flow to the veins and arteries, and a person who smokes cigarettes has an increased risk of developing ED. Smoking marijuana, especially when mixed tobacco, may confer a similar risk.

Cannabinoid receptors are present in the smooth muscle tissue of the penis. For this reason, it is theoretically possible for this to impair penile function, and this may lead to ED.
As you know, many men from ED take Viagra. And here it is very important to understand how Viagra and marijuana interact. Here https://www.edrugstore.com/blog/erectile-dysfunction/viagra/can-i-take-viagra-with-cannabis/?amp=1 there is more information about this and you can draw your own conclusions to avoid critical situations