Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vesin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ FetchContent_Declare(
# GIT_REPOSITORY https://github.com/rubber-duck-debug/gpu-lite.git
# GIT_TAG 78b4bad091e329b332def47ee9692e367a28ea85 # v1.0.0
GIT_REPOSITORY https://github.com/Luthaf/gpu-lite.git
GIT_TAG 223a893176a12a639a72d8b9fcc53135a7f15782
GIT_TAG b1672c8751ccb9411f2ff57c20e78959449862ad
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(gpulite)
Expand Down
33 changes: 27 additions & 6 deletions vesin/src/vesin_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,24 +329,45 @@ void vesin::cuda::free_neighbors(VesinNeighborList& neighbors) {
}

void checkCuda() {
std::string cuda_libname;
std::string cudart_libname;
std::string nvrtc_libname;
std::string suggestion;
#if defined(__linux__)
cuda_libname = "libcuda.so";
cudart_libname = "libcudart.so";
nvrtc_libname = "libnvrtc.so";
suggestion = ("Try appending the directory containing this library to "
"your $LD_LIBRARY_PATH environment variable.");

#elif defined(_WIN32)
cuda_libname = "nvcuda.dll";
cudart_libname = "cudart64_*.dll";
nvrtc_libname = "nvrtc64_*.dll";
suggestion = ("Try adding the directory containing this library to your "
"system PATH, or making sure that CUDA_PATH is properly set "
"to your CUDA installation directory.");
#else
cuda_libname = "cuda";
cudart_libname = "cudart";
nvrtc_libname = "nvrtc";
suggestion = "Unsupported platform: unable to load CUDA libraries.";
#endif
if (!CUDA_DRIVER_INSTANCE.loaded()) {
throw std::runtime_error(
"Failed to load libcuda.so. Try appending the directory containing this library to "
"your $LD_LIBRARY_PATH environment variable."
"Failed to load " + cuda_libname + ". " + suggestion
);
}

if (!CUDART_INSTANCE.loaded()) {
throw std::runtime_error(
"Failed to load libcudart.so. Try appending the directory containing this library to "
"your $LD_LIBRARY_PATH environment variable."
"Failed to load " + cudart_libname + ". " + suggestion
);
}

if (!NVRTC_INSTANCE.loaded()) {
throw std::runtime_error(
"Failed to load libnvrtc.so. Try appending the directory containing this library to "
"your $LD_LIBRARY_PATH environment variable."
"Failed to load " + nvrtc_libname + ". " + suggestion
);
}
}
Expand Down