The anti-sliding stability of gravity dam is always related to the overall safety of reservoir, and is very important. The paper adopted discrete element method to simulate the stability of dam base of complex structure surface that included bedding and joints. It also calculated the stability of dam body under two conditions of empty and full reservoir in different geological conditions. Study shows that the stability of dam is good when the reservoir is empty, while the reservoir is full of water, the stability of dam is affect significantly by the geological condition. Multiple sliding surface form are more better than double sliding surface form for the stability of dam. The stability is related to the position of the gravity dam centre. The results can be used for the design of gravity dam under complex geological condition.