aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-09-26 01:57:35 +0200
committerdec05eba <dec05eba@protonmail.com>2022-09-26 01:57:35 +0200
commitfebffdacc9af74b17a03790aecaa09281ed31d21 (patch)
treea5622faf0454784f9f9d536b5a4b7ab74e72687b
parenta648b591a0a5288f6c5ea8c8344d8b3d3299fdd5 (diff)
Load libcuda.so.1 if libcuda.so is missing
-rw-r--r--include/CudaLibrary.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/CudaLibrary.hpp b/include/CudaLibrary.hpp
index ac35113..134d19c 100644
--- a/include/CudaLibrary.hpp
+++ b/include/CudaLibrary.hpp
@@ -50,8 +50,11 @@ struct Cuda {
dlerror(); // clear
void *lib = dlopen("libcuda.so", RTLD_LAZY);
if(!lib) {
- fprintf(stderr, "Error: failed to load libcuda.so, error: %s\n", dlerror());
- return false;
+ lib = dlopen("libcuda.so.1", RTLD_LAZY);
+ if(!lib) {
+ fprintf(stderr, "Error: failed to load libcuda.so and libcuda.so.1, error: %s\n", dlerror());
+ return false;
+ }
}
cuInit = (CUINIT)load_symbol(lib, "cuInit");
@@ -126,4 +129,4 @@ private:
}
private:
void *library = nullptr;
-}; \ No newline at end of file
+};