If your alfredo sauce turned out grainy, it's usually because of one of the following reasons: Either the sauce started boiling, which caused the butter to separate OR The cheese got overcooked and either curdled or became grainy.  To prevent this in the future, make sure to keep your temperature on low and take the sauce off the heat once it's just mixed. The cheese will continue to melt and thicken the sauce off the heat too.