The medication , commonly known as Viagra, is a doctor-approved treatment primarily used to address difficulty achieving an erection in males . Developed initially for cardiovascular problems , its surprising side effects relating to vasodilation led to its subsequent use as an effective solution