torch-rb 0.22.1 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d15801cc8463969ebf374f668980c55da64203b973d673895a7315ae150387fd
4
- data.tar.gz: 1d4d3bd337f0b8645d642f92b74286996381dc1e3dad1f0d652f5e900cf60bcd
3
+ metadata.gz: 13a292607c0a4ecc21607db5128d779a2dbd349f9372fe7e140576af4b6e9e95
4
+ data.tar.gz: 5ce06edf45ef0c4e05d3e77b7517c3c15c3400c36d2b264afd6252bbd6de2ab1
5
5
  SHA512:
6
- metadata.gz: 52572a441989fcdb66840785354d6f5e5d9dfe431ead839ff6f38c9325bc3ec2c02c035b06adb6c3aeb2fa1c76db365ccf1d5f236f47bf97073a799a117ef7fd
7
- data.tar.gz: f156700996b6517b81d268477551c197b5119f910e6fe81dab92fea27d633bed82476fee679fe9c32231ef252b0fa19eb311ab670480816324d7074fcf3d8fef
6
+ metadata.gz: 24e8f8557835301ed533bcd52eaf22a5bad643d267f2cdc8d9f49c8b6306d844d4a12411e1f32bf0512d54b8f3637aed507fa22d0b8d3c6db3633f5a24a23470
7
+ data.tar.gz: 39f7d61b3f39dde83ff24eeef19996f907e3943017d2af7c16c1f18b22c1538f208be78e990177e70f33a7dffa40d87bdce0e740307fac2f7c8c8bf3e0ffea5e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.22.2 (2025-11-04)
2
+
3
+ - Added support for CUDA 12.9+
4
+
1
5
  ## 0.22.1 (2025-10-26)
2
6
 
3
7
  - Fixed error with Rice 4.7
data/ext/torch/extconf.rb CHANGED
@@ -33,9 +33,11 @@ unless inc && lib
33
33
  end
34
34
 
35
35
  cuda_inc, cuda_lib = dir_config("cuda")
36
- cuda_inc ||= "/usr/local/cuda/include"
37
36
  cuda_lib ||= "/usr/local/cuda/lib64"
38
37
 
38
+ cudnn_inc, cudnn_lib = dir_config("cudnn")
39
+ cudnn_lib ||= "/usr/local/cuda/lib"
40
+
39
41
  $LDFLAGS += " -L#{lib}" if Dir.exist?(lib)
40
42
  abort "LibTorch not found" unless have_library("torch")
41
43
 
@@ -45,6 +47,7 @@ have_library("nnpack")
45
47
  with_cuda = false
46
48
  if Dir["#{lib}/*torch_cuda*"].any?
47
49
  $LDFLAGS += " -L#{cuda_lib}" if Dir.exist?(cuda_lib)
50
+ $LDFLAGS += " -L#{cudnn_lib}" if Dir.exist?(cudnn_lib) && cudnn_lib != cuda_lib
48
51
  with_cuda = have_library("cuda") && have_library("cudnn")
49
52
  end
50
53
 
@@ -57,10 +60,12 @@ if RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /
57
60
  end
58
61
  $LDFLAGS += ":#{cuda_lib}/stubs:#{cuda_lib}" if with_cuda
59
62
 
60
- # https://github.com/pytorch/pytorch/blob/v1.5.0/torch/utils/cpp_extension.py#L1232-L1238
63
+ # https://github.com/pytorch/pytorch/blob/v2.9.0/torch/utils/cpp_extension.py#L1351-L1364
61
64
  $LDFLAGS += " -lc10 -ltorch_cpu -ltorch"
62
65
  if with_cuda
63
- $LDFLAGS += " -lcuda -lnvrtc -lnvToolsExt -lcudart -lc10_cuda -ltorch_cuda -lcufft -lcurand -lcublas -lcudnn"
66
+ $LDFLAGS += " -lcuda -lnvrtc"
67
+ $LDFLAGS += " -lnvToolsExt" if File.exist?("#{cuda_lib}/libnvToolsExt.so")
68
+ $LDFLAGS += " -lcudart -lc10_cuda -ltorch_cuda -lcufft -lcurand -lcublas -lcudnn"
64
69
  # TODO figure out why this is needed
65
70
  $LDFLAGS += " -Wl,--no-as-needed,#{lib}/libtorch.so"
66
71
  end
data/lib/torch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Torch
2
- VERSION = "0.22.1"
2
+ VERSION = "0.22.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torch-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.1
4
+ version: 0.22.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane