This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
Repositories
Datasets
Forum
实训
竞赛
大数据
应用
Register
Sign In
OpenI
/
MegEngine
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
31
Wiki
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
Browse Source
fix(mgb): fix the compatibility issue of cuda stub with older version drivers
GitOrigin-RevId:
628afbf3cf
dev-support-lite-fork-debug-mode
Megvii Engine Team
2 years ago
parent
a6a2646c10
commit
1404437a90
7 changed files
with
48 additions
and
8 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
dnn/cuda-stub/src/dlopen_helper.h
+9
-1
dnn/cuda-stub/src/libcuda-wrap_10.1.h
+9
-1
dnn/cuda-stub/src/libcuda-wrap_10.2.h
+9
-1
dnn/cuda-stub/src/libcuda-wrap_11.1.h
+9
-1
dnn/cuda-stub/src/libcuda-wrap_11.2.h
+9
-1
dnn/cuda-stub/src/libcuda-wrap_11.4.h
+2
-2
dnn/cuda-stub/src/libcuda.cpp
+ 1
- 1
dnn/cuda-stub/src/dlopen_helper.h
View File
@@ -111,7 +111,7 @@ static void* resolve_library_func(void* handle, const char* func) {
}
auto ret = dlsym(handle, func);
if (!ret) {
LOGD("failed to load %s func: %s", g_default_api_name, func);
LOGD("failed to load %s func: %s
.(It seems that the currently used version of the library containing the function is too old.)
", g_default_api_name, func);
}
return ret;
}
+ 9
- 1
dnn/cuda-stub/src/libcuda-wrap_10.1.h
View File
@@ -3829,6 +3829,7 @@ static void load_library() {
return;
void* handle = get_library_handle();
int num = 0;
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func;
if (!handle) {
@@ -3837,10 +3838,17 @@ static void load_library() {
func = resolve_library_func(handle, g_func_name[i]);
}
if (!func) {
func = g_func_table_error[i]
;
break
;
}
num++;
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
if (num != NR_FUNC) {
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func = g_func_table_error[i];
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
}
done = true;
}
+ 9
- 1
dnn/cuda-stub/src/libcuda-wrap_10.2.h
View File
@@ -3999,6 +3999,7 @@ static void load_library() {
return;
void* handle = get_library_handle();
int num = 0;
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func;
if (!handle) {
@@ -4007,10 +4008,17 @@ static void load_library() {
func = resolve_library_func(handle, g_func_name[i]);
}
if (!func) {
func = g_func_table_error[i]
;
break
;
}
num++;
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
if (num != NR_FUNC) {
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func = g_func_table_error[i];
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
}
done = true;
}
+ 9
- 1
dnn/cuda-stub/src/libcuda-wrap_11.1.h
View File
@@ -4369,6 +4369,7 @@ static void load_library() {
return;
void* handle = get_library_handle();
int num = 0;
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func;
if (!handle) {
@@ -4377,10 +4378,17 @@ static void load_library() {
func = resolve_library_func(handle, g_func_name[i]);
}
if (!func) {
func = g_func_table_error[i]
;
break
;
}
num++;
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
if (num != NR_FUNC) {
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func = g_func_table_error[i];
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
}
done = true;
}
+ 9
- 1
dnn/cuda-stub/src/libcuda-wrap_11.2.h
View File
@@ -4659,6 +4659,7 @@ static void load_library() {
return;
void* handle = get_library_handle();
int num = 0;
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func;
if (!handle) {
@@ -4667,10 +4668,17 @@ static void load_library() {
func = resolve_library_func(handle, g_func_name[i]);
}
if (!func) {
func = g_func_table_error[i]
;
break
;
}
num++;
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
if (num != NR_FUNC) {
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func = g_func_table_error[i];
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
}
done = true;
}
+ 9
- 1
dnn/cuda-stub/src/libcuda-wrap_11.4.h
View File
@@ -4899,6 +4899,7 @@ static void load_library() {
return;
void* handle = get_library_handle();
int num = 0;
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func;
if (!handle) {
@@ -4907,10 +4908,17 @@ static void load_library() {
func = resolve_library_func(handle, g_func_name[i]);
}
if (!func) {
func = g_func_table_error[i]
;
break
;
}
num++;
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
if (num != NR_FUNC) {
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func = g_func_table_error[i];
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
}
done = true;
}
+ 2
- 2
dnn/cuda-stub/src/libcuda.cpp
View File
@@ -3,8 +3,8 @@
#pragma GCC visibility push(default)
#include <cstdio>
#define LOGI(fmt, v...) fprintf(std
out
, "info: " fmt "\n", ##v)
#define LOGD(fmt, v...) fprintf(std
out
, "debug: " fmt "\n", ##v)
#define LOGI(fmt, v...) fprintf(std
err
, "info: " fmt "\n", ##v)
#define LOGD(fmt, v...) fprintf(std
err
, "debug: " fmt "\n", ##v)
extern "C" {
#include "cuda.h"
Write
Preview
Loading…
Cancel
Save