Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onnxruntime_providers_cuda.dll cannot be loaded due to "Can't find dependent libraries" under Windows 10 environment using Java #16821

Open
felixchan68 opened this issue Jul 23, 2023 · 2 comments
Labels
api:Java issues related to the Java API ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform

Comments

@felixchan68
Copy link

Describe the issue

Try to execute the Java code under Windows 10 environment with GPU supported,

onnxruntime_providers_cuda.dll: Can't find dependent libraries will be shown during the code execution. Detail reported under the "To reproduce" section.

The native library "onnxruntime_providers_cuda.dll" extracted from the path "ai/onnxruntime/native/win-x64/" within the onnxruntime_gpu-1.15.1.jar are included within the IDE Eclipse

To reproduce

public static void main (String [] args) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
System.loadLibrary("onnxruntime_providers_cuda"); // <-- will show "Can't find dependent libraries" during runtime

OrtEnvironment environment = OrtEnvironment.getEnvironment();
OrtSession.SessionOptions sessionOptions = new OrtSession.SessionOptions();

sessionOptions.setOptimizationLevel(OrtSession.SessionOptions.OptLevel.ALL_OPT);
sessionOptions.addCPU(false);
sessionOptions.addCUDA(0); // <-- will show "LoadLibrary failed with error 126 " when trying to load onnxruntime_providers_cuda.dll" during runtime

}

Urgency

Yes project blocked if no GPU supported

Platform

Windows

OS Version

10

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.15.1

ONNX Runtime API

Java

Architecture

X64

Execution Provider

CUDA

Execution Provider Library Version

Build cuda_12.2.r12.2/compiler.32965470_0

@github-actions github-actions bot added api:Java issues related to the Java API ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform labels Jul 23, 2023
@skottmckay
Copy link
Contributor

Have you installed cuDNN and its dependencies as those are required? https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html

CUDA 12 isn't officially supported yet. #16675 (comment)

However, others have successfully used ORT with CUDA 12. #16713 (comment)

@mszhanyi
Copy link
Contributor

mszhanyi commented Sep 20, 2023

Could you please check C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v{cu_version}\extras\CUPTI\lib64 in PATH
{cu_version} stands for the CUDA you installed, e.g. 11.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:Java issues related to the Java API ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants