fixing bugs with multi-gpu support. linux build.