onnxruntime
61244135 - Remove unused cusparse library dependency (#27467)

Commit
37 days ago
Remove unused cusparse library dependency (#27467) ### Description `cusparse` was never used in the codebase — only included in a PCH and referenced by dead helper macros. Removes all traces of it. - **`cuda_pch.h`**: Remove `#include <cusparse.h>` - **`shared_inc/cuda_call.h`**: Remove `CUSPARSE_CALL` and `CUSPARSE_CALL_THROW` macros - **`cuda_common.h`**: Remove `CUSPARSE_RETURN_IF_ERROR` macro - **`cmake/CMakeLists.txt`**: Remove `DISABLE_CUSPARSE_DEPRECATED` compile definition ### Motivation and Context `cusparse` was pulled in unconditionally but had no actual call sites. This blocked builds against minimal CUDA installations that don't ship the full toolkit. Resolves that friction with no functional impact. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[Build] Nvidia cusparse library seems to be unused</issue_title> > <issue_description>### Describe the issue > > **Problem** > While building onnxruntime, I noticed that the cusparse library seems to be unused. At least the only usage I could find: > - An include: [./onnxruntime/core/providers/cuda/cuda_pch.h](./onnxruntime/core/providers/cuda/cuda_pch.h) > - Default error handling in [./onnxruntime/core/providers\cuda/shared_inc/cuda_call.h](./onnxruntime/core/providers\cuda/shared_inc/cuda_call.h) and [./onnxruntime/core/providers/cuda/cuda_common.h](./onnxruntime/core/providers/cuda/cuda_common.h). I could not find any usages of the macros `CUSPARSE_CALL` and `CUSPARSE_RETURN_IF_ERROR` > > In case cusparse is not used, it might be better to remove the dependency to that library. > > **Motivation** > While building onnxruntime with a minimal CUDA build (the full CUDA toolkit being not installed), I noticed the usages of these libraries. When I remove them, onnxruntime still builds fine. Removing the usage in the first place would make it easier to build onnxruntime with a custom minimal CUDA build. > > Of course, if you want to keep the helper functions for easier future re-use, I can completely understand and we can just close this issue in that case. If you think removing the dependency to cusparse would be good, I could make a PR. > > ### Urgency > > No urgency. > > ### Target platform > > Any > > ### Build script > > Custom > > ### Error / output > > None > > ### Visual Studio Version > > _No response_ > > ### GCC / Compiler Version > > _No response_</issue_description> > > <agent_instructions>Please remove cusparse and related code.</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes microsoft/onnxruntime#27443 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Author
Parents
Loading