From febffdacc9af74b17a03790aecaa09281ed31d21 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 26 Sep 2022 01:57:35 +0200 Subject: Load libcuda.so.1 if libcuda.so is missing --- include/CudaLibrary.hpp | 9 ++++++--- 1 file 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 +}; -- cgit v1.2.3