[PATCH] D147579: [nvptx-arch] Dynamically load `libcuda.so.1` directly instead

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 4 16:12:25 PDT 2023


jhuber6 created this revision.
jhuber6 added a reviewer: tra.
Herald added subscribers: mattd, gchakrabarti, asavonic, yaxunl.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: cfe-commits, jholewinski.
Herald added a project: clang.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147579

Files:
  clang/tools/nvptx-arch/NVPTXArch.cpp


Index: clang/tools/nvptx-arch/NVPTXArch.cpp
===================================================================
--- clang/tools/nvptx-arch/NVPTXArch.cpp
+++ clang/tools/nvptx-arch/NVPTXArch.cpp
@@ -49,7 +49,7 @@
 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147579.510957.patch
Type: text/x-patch
Size: 492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230404/0a624f94/attachment-0001.bin>


More information about the cfe-commits mailing list