Skip to content

Commit

Permalink
Fall back to libibverbs.so.1 (#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
372046933 authored Nov 10, 2022
1 parent cc629b6 commit 2a00420
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/cn/rdma.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ make
使用bazel:
```bash
# Server
bazel build example:rdma_performance_server
bazel build --define=BRPC_WITH_RDMA=true example:rdma_performance_server
# Client
bazel build example:rdma_performance_client
bazel build --define=BRPC_WITH_RDMA=true example:rdma_performance_client
```

# 基本实现
Expand Down
4 changes: 2 additions & 2 deletions docs/en/rdma.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ make
With bazel:
```bash
# Server
bazel build example:rdma_performance_server
bazel build --define=BRPC_WITH_RDMA=true example:rdma_performance_server
# Client
bazel build example:rdma_performance_client
bazel build --define=BRPC_WITH_RDMA=true example:rdma_performance_client
```

# Basic Implementation
Expand Down
10 changes: 8 additions & 2 deletions src/brpc/rdma/rdma_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,14 @@ static void OnRdmaAsyncEvent(Socket* m) {
static int ReadRdmaDynamicLib() {
g_handle_ibverbs = dlopen("libibverbs.so", RTLD_LAZY);
if (!g_handle_ibverbs) {
LOG(ERROR) << "Fail to load libibverbs.so due to " << dlerror();
return -1;
LOG(WARNING) << "Failed to load libibverbs.so " << dlerror() << " try libibverbs.so.1";
// Clear existing error
dlerror();
g_handle_ibverbs = dlopen("libibverbs.so.1", RTLD_LAZY);
if (!g_handle_ibverbs) {
LOG(ERROR) << "Fail to load libibverbs.so.1 due to " << dlerror();
return -1;
}
}

LoadSymbol(g_handle_ibverbs, IbvGetDeviceList, "ibv_get_device_list");
Expand Down

0 comments on commit 2a00420

Please sign in to comment.