Viagra, generically referred to as sildenafil, is the medication primarily intended to treat erectile impairment , a ailment where men have challenges achieving or maintaining an erection . Beyond the primary purpose, it is sometimes found off-label for pulmonary high blood pressure in the lungs