Adapt to GPU memory size and z move changes