Skip to content

Commit

Permalink
Include CUDA_VISIBLE_DEVICES into shm hash, so same db can be loaded …
Browse files Browse the repository at this point in the history
…into multiple GPUs
  • Loading branch information
milot-mirdita committed Jan 18, 2025
1 parent e095774 commit b804fbe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/commons/GpuUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ struct GPUSharedMemory {

static std::string getShmHash(const std::string& db) {
std::string dbpath = FileUtil::getRealPathFromSymLink(PrefilteringIndexReader::dbPathWithoutIndex(db));
char* visibleDevices = getenv("CUDA_VISIBLE_DEVICES");
if (visibleDevices) {
dbpath.append(visibleDevices);
}
size_t hash = Util::hash(dbpath.c_str(), dbpath.length());
return SSTR(hash);
}
Expand Down

0 comments on commit b804fbe

Please sign in to comment.