Intelligence is not even required, any self replicating machines which are effective enough can kill everyone. Maybe some people will hide and live between rocks of some mountains, where some jumping head-cutting machines can't operate efficiently. Nuclear is not good example, it does not self-replicate. Fire is more dangerous in some sense, viruses, etc. AI can assist in making dumb but efficient self-replicating killing machines that do not have any external controls, so they can't be stopped using some command/button.