I'll answer your question directly and then throw in my $.02. Most schools look at your entire GPA AND your major GPA. They use this as part of their holistic approach at gauging you as a potential contributor to their research base. Some schools do not care about your major GPA, they want to see how well rounded you are. I know from personal experience that USC looks at the entire GPA and, unfortunately, rarely admits those with a cumulative GPA below 3.5 into their STEM grad programs (not to mention that they also usually don't fund grad students, a right they reserve for their PhD students solely).
Now my $.02 :
First off, the grad school admissions process is impossible to describe with any semblance of universality or accuracy. That being said, in my research while applying to grad schools I found that a GPA of less than 3.5 will probably occlude your chances of getting into a grad school like USC or UCLA unless you have some really phenomenal research achievements as an undergrad or other special characteristics like your parents donated a lot of money to the school or you went there as an undergrad so some of the professors on the admissions counsel might know you and thus know your compatibility with the "rigorous" requirements of grad studies.
Other factor that drastically help your chances are your recommendations (if strong) and your Statement of Purpose. These are probably the most important parts. In your SOP you can write a short paragraph explaining any less than spectacular academic performance and show how you have rebounded from it to become the type of student they really want.