Raonic, the world number six, cruised through the first set 6-1 in 21 minutes and led 1-0 in the second when the Spaniard retired at the changeover after a brief exchange with his opponent.
"He told me he had dealt with this in his first rounds. He was happy to have gone through the first two matches and he could not bear it any more," Raonic told reporters.
The 26-year-old Canadian, who will next face Spaniard Pablo Carreno Busta, had been struggling with an injury himself earlier this season and said he was happy not to have played longer even though it was unfortunate how it had come about.
"I take it when I can have it. I have played a lot in the last weeks. I made good progress and am getting better and better," he said.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Earlier in the year, Raonic pulled out of the Delray Beach final due to a hamstring injury and he also withdrew from Acapulco and Indian Wells.
(Reporting by Karolos Grohmann; Editing by Ken Ferris)
