python gpu locking for linux