I think it does.
In many high schools in America, social groups tend to follow racial lines, though by no means absolutely. If you're a white or Asian nerd, there are plenty of other similar nerds for you to associate with. However, if you're a black or Hispanic nerd, there aren't so many.
For me, this never ended up being a problem because all of the nerds shared almost every class, so we ended up being a pretty tight group on our own. For a black nerd who wasn't as nerdy as I am, things were probably more difficult. He wouldn't be in all of the same classes, so he wouldn't grow as close to the nerds, but he'd still be relatively isolated from the "normal" black people.
It seems that blacks and Hispanics have a larger social disincentive for being a nerd than other groups, though that is probably on the lower end of factors that contribute to underrepresentation in the nerd population.
Popularity depends on what you do better than the average guy and where you do it.
In America (where Hollywood and Sports are kings) if you play football better than 98% of your schoolmates you are likely to be popular. The same does not hold truth for a top programmer within is high school.
In some parts of your continent, yo could be the best soccer player in the neighborhood, it would not matter. The kid who gets the girl is the kid who scores As in school, although that kid is not much worried about girls.