Grainy and curdled ganache is a sign that the emulsion has broken. The most common reason for an emulsion break is insufficient liquid to hold all the fat globules in suspension. To fix this, reheat the ganache on a double boiler, whisking vigorously. If the emulsion is still not repaired, stir in a splash of room temperature milk. It may be tempting to use cream but don't, as cream contains a lot of fat and will only worsen a broken emulsion.