fix the gpu initialization for multiple cards