Optimize the gpu consumption