Skip to content

Commit b804fbe

Browse files
committed
Include CUDA_VISIBLE_DEVICES into shm hash, so same db can be loaded into multiple GPUs
1 parent e095774 commit b804fbe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/commons/GpuUtil.h

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ struct GPUSharedMemory {
4141

4242
static std::string getShmHash(const std::string& db) {
4343
std::string dbpath = FileUtil::getRealPathFromSymLink(PrefilteringIndexReader::dbPathWithoutIndex(db));
44+
char* visibleDevices = getenv("CUDA_VISIBLE_DEVICES");
45+
if (visibleDevices) {
46+
dbpath.append(visibleDevices);
47+
}
4448
size_t hash = Util::hash(dbpath.c_str(), dbpath.length());
4549
return SSTR(hash);
4650
}

0 commit comments

Comments
 (0)