The epidermal growth factor receptor (EGFR) is a major target for drugs in treating lung carcinoma. Mutations in the tyrosine kinase domain of EGFR commonly arise in human cancers, which can cause drug sensitivity or resistance by influencing the relative strengths of drug and ATP-binding. In this study, we investigate the binding affinities of two tyrosine kinase inhibitors--AEE788 and Gefitinib--to EGFR using molecular dynamics simulation. The interactions between these inhibitors and the EGFR kinase domain are analysed using multiple short (ensemble) simulations and the molecular mechanics/Poisson-Boltzmann solvent area (MM/PBSA) method. Here, we show that ensemble simulations correctly rank the binding affinities for these systems: we report the successful ranking of each drug binding to a variety of EGFR sequences and of the two drugs binding to a given sequence, using petascale computing resources, within a few days.