Skip to content

Commit 09e5711

Browse files
authored
gloo/ibverbs: enable gpudirect with new nvidia drivers
Differential Revision: D74495060 Pull Request resolved: #438
1 parent 7a4c857 commit 09e5711

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

gloo/transport/ibverbs/device.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ namespace gloo {
2424
namespace transport {
2525
namespace ibverbs {
2626

27+
namespace {
28+
bool hasNvPeerMem() {
29+
const auto& modules = kernelModules();
30+
return modules.count("nv_peer_mem") > 0 ||
31+
// Newer nvidia drivers use a different module name
32+
modules.count("nvidia_peermem") > 0;
33+
}
34+
} // namespace
35+
2736
// Scope guard for ibverbs device list.
2837
class IbvDevices {
2938
public:
@@ -112,7 +121,7 @@ std::shared_ptr<::gloo::transport::Device> CreateDevice(
112121
Device::Device(const struct attr& attr, ibv_context* context)
113122
: attr_(attr),
114123
pciBusID_(infinibandToBusID(attr.name)),
115-
hasNvPeerMem_(kernelModules().count("nv_peer_mem") > 0),
124+
hasNvPeerMem_(hasNvPeerMem()),
116125
context_(context) {
117126
int rv;
118127

0 commit comments

Comments
 (0)