Surgery: If neither drugs nor the vacuum pump works, your doctor may suggest surgery. With surgery, the doctor can place a device in your penis that will cause enough hardness for intercourse. In a few cases, infections may develop after the operation, and the doctor may have to remove the device. Another operation that may help you is rebuilding the blood vessels in the penis to increase blood flow into the penis or decrease blood flow out of the penis. These procedures can help you to get and maintain an erection.
The association between low testosterone and ED is not entirely clear. Although these 2 processes certainly overlap in some instances, they are distinct entities. Some 2-21% of men have both hypogonadism and ED; however, it is unclear to what degree treating the former will improve erectile function.  About 35-40% of men with low testosterone see an improvement in their erections with testosterone replacement; however, almost 65% of these men see no improvement. 
No nitrate-based drugs should be given to men with suspected heart attacks if they have taken PDE5i medications within 24 hours. Combining PDE5i with nitrate-based medications can cause a severe and dramatic drop in blood pressure with potentially very dangerous consequences. This is also why someone should absolutely never share PDE5i medications with anyone else. If they happen to be taking one of the drugs that interacts dangerously with PDE5i medications, the results could be very serious. If there is any question about possible drug interactions, always check with a doctor or pharmacist.
A physical exam checks your total health. Examination focusing on your genitals (penis and testicles) is often done to check for ED. Based on your age and risk factors, the exam may also focus on your heart and blood system: heart, peripheral pulses and blood pressure. Based on your age and family history your doctor may do a rectal exam to check the prostate. These tests are not painful. Most patients do not need a lot of testing before starting treatment.