message: Allow multiple libtpus to load if TPU_VISIBLE_DEVICES is set
diff: @@ -45,9 +45,11 @@ bool TryAcquireTpuLock() {
  }
  should_load_library = true;
  - // if the TPU_HOST_BOUNDS env var is set, that means we are loading each
  - // chip in a different process and thus multiple libtpu loads are OK.
  - if (getenv("TPU_HOST_BOUNDS") == nullptr) {
  + // if the TPU_HOST_BOUNDS or TPU_VISIBLE_DEVICES env var is set, that means
  + // we are loading each chip in a different process and thus multiple libtpu
  + // loads are OK.
  + if (getenv("TPU_HOST_BOUNDS") == nullptr &&
  + getenv("TPU_VISIBLE_DEVICES") == nullptr) {
  int fd = open("/tmp/libtpu_lockfile", O_CREAT | O_RDWR, 0644);
  // This lock is held until the process exits intentionally. The underlying
  