selecting cuda device semi-intelligently