Skip to content

Commit

Permalink
[nvptx-arch] Dynamically load libcuda.so.1 directly instead
Browse files Browse the repository at this point in the history
This patch loads the CUDA driver library directly via its real
`DT_SONAME`. This prevents the filesystem from needing to reload it in
cases when it's already loaded.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D147579
  • Loading branch information
jhuber6 committed Apr 5, 2023
1 parent 5b461d5 commit ad6a7d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/tools/nvptx-arch/NVPTXArch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CUresult (*cuGetErrorString)(CUresult, const char **);
CUresult (*cuDeviceGet)(CUdevice *, int);
CUresult (*cuDeviceGetAttribute)(int *, CUdevice_attribute, CUdevice);

constexpr const char *DynamicCudaPath = "libcuda.so";
constexpr const char *DynamicCudaPath = "libcuda.so.1";

llvm::Error loadCUDA() {
std::string ErrMsg;
Expand Down

0 comments on commit ad6a7d7

Please sign in to comment.