Skip to content

Commit 2bc75cb

Browse files
committed
Revert "Links most cuda libs to jnitorch_cuda only" and preload/link cleanup
1 parent d71057a commit 2bc75cb

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

pytorch/src/main/java/org/bytedeco/pytorch/presets/torch.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
},
8888
exclude = {"openblas_config.h", "cblas.h", "lapacke_config.h", "lapacke_mangling.h", "lapack.h", "lapacke.h", "lapacke_utils.h"},
89-
preload = { "asmjit", "fbgemm" }
89+
link = { "torch" }
9090
),
9191
@Platform(
9292
value = {"linux", "macosx", "windows"},
@@ -105,16 +105,27 @@
105105
),
106106
@Platform(
107107
value = {"linux"},
108-
link = { "c10", "torch_cpu" }
108+
preload = { "c10", "torch_cpu" },
109+
109110
),
110111
@Platform(
111112
value = {"macosx"},
112-
link = { "c10", "torch_cpu", "iomp5" }
113+
preload = { "c10", "torch_cpu", "iomp5" }
113114
),
114115
@Platform(
115116
value = "windows",
116-
link = { "c10", "torch_cpu", "uv" }
117+
preload = { "c10", "torch_cpu", "uv" }
118+
),
119+
@Platform(
120+
value = "linux",
121+
extension = "-gpu",
122+
preload = { "c10", "torch_cpu", "c10_cuda", "torch_cuda" }
117123
),
124+
@Platform(
125+
value = "windows",
126+
extension = "-gpu",
127+
preload = { "c10", "torch_cpu", "uv", "c10_cuda", "torch_cuda" }
128+
)
118129
},
119130
target = "org.bytedeco.pytorch",
120131
global = "org.bytedeco.pytorch.global.torch"
@@ -1959,11 +1970,11 @@ We need either to put an annotation info on each member, or javaName("@NoOffset
19591970
"c10::DDPLoggingData::strs_map",
19601971
"c10::DDPLoggingData::ints_map",
19611972
"torch::dynamo::autograd::TensorArgs::inputs",
1973+
"torch::dynamo::autograd::AutogradCompilerCall::tensor_args",
19621974
"torch::dynamo::autograd::AutogradCompilerCall::all_size_inputs",
19631975
"torch::dynamo::autograd::AutogradCompilerCall::dyn_size_inputs",
19641976
"torch::dynamo::autograd::AutogradCompilerCall::node_calls",
19651977
"torch::dynamo::autograd::AutogradCompilerCall::default_dyn_type",
1966-
"torch::dynamo::autograd::AutogradCompilerCall::tensor_args",
19671978
"torch::jit::Object::Property::setter_func",
19681979
"torch::jit::Object::Property::getter_func",
19691980
"torch::jit::Object::Property::name",

pytorch/src/main/java/org/bytedeco/pytorch/presets/torch_cuda.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,12 @@
5858
@Platform(
5959
value = "linux",
6060
extension = "-gpu",
61-
link = { "c10", "torch_cpu", "c10_cuda", "torch_cuda", "torch_cuda_linalg", "cudart", "cupti", "cusparse", "cudnn" }, // cuda_linalg built as separate lib on linux only
62-
linkpath = {
63-
"/usr/local/cuda-12.3/lib64/",
64-
"/usr/local/cuda/lib64/",
65-
"/usr/local/cuda-12.3/extras/CUPTI/lib64/",
66-
"/usr/lib64/"
67-
}
61+
link = { "torch" , "c10_cuda", "torch_cuda_linalg" } // cuda_linalg built as separate lib on linux only
6862
),
6963
@Platform(
7064
value = "windows",
7165
extension = "-gpu",
72-
link = { "c10", "torch_cpu", "uv", "c10_cuda", "torch_cuda", "cudart", "cupti", "cusparse", "cudnn" },
73-
linkpath = {
74-
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3/lib/x64/",
75-
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3/extras/CUPTI/lib64/"
76-
}
66+
link = { "torch" , "c10_cuda" }
7767
)
7868
},
7969
target = "org.bytedeco.pytorch.cuda",

0 commit comments

Comments
 (0)