File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,15 @@ namespace gloo {
2424namespace transport {
2525namespace 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.
2837class IbvDevices {
2938 public:
@@ -112,7 +121,7 @@ std::shared_ptr<::gloo::transport::Device> CreateDevice(
112121Device::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
You can’t perform that action at this time.
0 commit comments