djl icon indicating copy to clipboard operation
djl copied to clipboard

How to set Pytorch Native Library to PATH?

Open ThiloteE opened this issue 5 months ago • 0 comments

I am on Windows 10.

Some months ago, I found out that having (multiple) Cuda installed on your system creates conflicts that causes the cuda contained in djl files not to be detected. I added this knowledge to the djl documentation here: https://docs.djl.ai/master/docs/development/troubleshooting.html#causes-on-windows. At https://github.com/deepjavalibrary/djl/issues/2731#issuecomment-1660502794 it is also mentioned that Cuda is not directly installed by djl, but rather only the Pytorch Native Library (which contains Cuda files). Unfortunately, I only can use AI features with JabRef that are based on djl, when I remove all manually installed Cudas on my system.

Today I installed Cuda 12.9 from the Nvidia website (which was automatically added to PATH during the installation), then downloaded the djl Pytorch native library as automatically provided by JabRef's newest development version, when AI features are enabled in the preferences:

PyTorch engine version PyTorch native library version
pytorch-engine:0.33.0 2.5.1

Now, when I go to to the folder that contains JabRef's source code, open cmd and execute the command nvcc --version, it shows, as you can see down below, that I am still on cuda 12.9.

C:\Prog\Development\JabRef_JabRef-JabRef\JabRef-JabRef\jabref>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Tue_May_27_02:24:01_Pacific_Daylight_Time_2025
Cuda compilation tools, release 12.9, V12.9.86
Build cuda_12.9.r12.9/compiler.36037853_0

I tried adding C:\Users\USER\.djl.ai\pytorch\2.5.1-cu124-win-x86_64 to PATH, but it doesn't work.

Image

What do I do wrong?

ThiloteE avatar Jun 09 '25 21:06 ThiloteE