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

Java library throws error when using CUDA: LoadLibrary failed with error 126 "" when trying to load "C:\Users\xx\AppData\Local\Temp\onnxruntime-java5278075328315693241\onnxruntime_providers_cuda.dll" #23208

Open
sduqlsc opened this issue Dec 27, 2024 · 1 comment
Labels
api:Java issues related to the Java API ep:CUDA issues related to the CUDA execution provider

Comments

@sduqlsc
Copy link

sduqlsc commented Dec 27, 2024

Describe the issue

use Java onnx gpu library and enable gpu, throws error

ai.onnxruntime.OrtException: Error code - ORT_RUNTIME_EXCEPTION - message: D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1539 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\Users\xxx\AppData\Local\Temp\onnxruntime-java5278075328315693241\onnxruntime_providers_cuda.dll"

        <dependency>
            <groupId>com.microsoft.onnxruntime</groupId>
            <artifactId>onnxruntime_gpu</artifactId>
            <version>1.20.0</version>
        </dependency>
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Nov_22_10:30:42_Pacific_Standard_Time_2023
Cuda compilation tools, release 12.3, V12.3.107
Build cuda_12.3.r12.3/compiler.33567101_0
NVIDIA-SMI 546.33                 Driver Version: 546.33       CUDA Version: 12.3 

I did check the tmp folder, the dll was missing.

To reproduce

// JDK 11
env = OrtEnvironment.getEnvironment();
OrtSession.SessionOptions sessionOptions = new OrtSession.SessionOptions();

sessionOptions.addCUDA(0);
session = env.createSession(weight, sessionOptions);

CUDA & CUDNN PATH configuration:

Image
Image

Urgency

No response

Platform

Windows

OS Version

11

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

onnxruntime_gpu 1.20.0

ONNX Runtime API

Java

Architecture

X64

Execution Provider

CUDA

Execution Provider Library Version

CUDA 12.3

@github-actions github-actions bot added ep:CUDA issues related to the CUDA execution provider api:Java issues related to the Java API labels Dec 27, 2024
@Craigacp
Copy link
Contributor

Are the CUDA dlls on your system %PATH%?

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
Projects
None yet
Development

No branches or pull requests

2 participants