Viagra, generically referred to as sildenafil, is a treatment primarily used to treat erectile dysfunction , a condition where individuals have challenges achieving or keeping an erection of the penis . Beyond the primary purpose, it is sometimes found off-label in the treatment of pulmonary hypertension and other medical conditions . However that