refactored gpu mem validation