@@ -25,46 +25,52 @@ http_archive(
25
25
load ("@rules_pkg//:deps.bzl" , "rules_pkg_dependencies" )
26
26
rules_pkg_dependencies ()
27
27
28
- # CUDA should be installed on the system locally
29
- #new_local_repository(
30
- # name = "cuda ",
31
- # path = "/usr/local/cuda-10.2/targets/x86_64-linux/ ",
32
- # build_file = "@//third_party/cuda:BUILD",
33
- # )
28
+ git_repository (
29
+ name = "googletest" ,
30
+ remote = "https://github.com/google/googletest " ,
31
+ commit = "703bd9caab50b139428cea1aaff9974ebee5742e " ,
32
+ shallow_since = "1570114335 -0400"
33
+ )
34
34
35
- http_archive (
36
- name = "libtorch_pre_cxx11_abi" ,
37
- build_file = "@//third_party/libtorch:BUILD" ,
38
- strip_prefix = "libtorch" ,
39
- sha256 = "ea8de17c5f70015583f3a7a43c7a5cdf91a1d4bd19a6a7bc11f074ef6cd69e27" ,
40
- urls = ["https://download.pytorch.org/libtorch/cu102/libtorch-shared-with-deps-1.5.0.zip" ],
35
+ # CUDA should be installed on the system locally
36
+ new_local_repository (
37
+ name = "cuda" ,
38
+ path = "/usr/local/cuda-10.2/" ,
39
+ build_file = "@//third_party/cuda:BUILD" ,
41
40
)
42
41
43
- http_archive (
44
- name = "libtorch" ,
45
- build_file = "@//third_party/libtorch:BUILD" ,
46
- strip_prefix = "libtorch" ,
47
- urls = ["https://download.pytorch.org/libtorch/cu102/libtorch-cxx11-abi-shared-with-deps-1.5.0.zip" ],
48
- sha256 = "0efdd4e709ab11088fa75f0501c19b0e294404231442bab1d1fb953924feb6b5"
42
+ new_local_repository (
43
+ name = "cublas" ,
44
+ path = "/usr" ,
45
+ build_file = "@//third_party/cublas:BUILD" ,
49
46
)
50
47
51
- #pip3_import(
52
- # name = "trtorch_py_deps",
53
- # requirements = "//py:requirements.txt"
54
- #)
48
+ #############################################################################################################
49
+ # Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs)
50
+ #############################################################################################################
55
51
56
- #load("@trtorch_py_deps//:requirements.bzl", "pip_install")
57
- #pip_install()
52
+ # TODO: Uncomment these and comment out the lower section before merge into master
58
53
59
- #pip3_import(
60
- # name = "py_test_deps",
61
- # requirements = "//tests/py:requirements.txt"
62
- #)
54
+ # http_archive(
55
+ # name = "libtorch",
56
+ # build_file = "@//third_party/libtorch:BUILD",
57
+ # strip_prefix = "libtorch",
58
+ # urls = ["https://download.pytorch.org/libtorch/cu102/libtorch-cxx11-abi-shared-with-deps-1.5.0.zip"],
59
+ # sha256 = "0efdd4e709ab11088fa75f0501c19b0e294404231442bab1d1fb953924feb6b5"
60
+ # )
63
61
64
- #load("@py_test_deps//:requirements.bzl", "pip_install")
65
- #pip_install()
62
+ # http_archive(
63
+ # name = "libtorch_pre_cxx11_abi",
64
+ # build_file = "@//third_party/libtorch:BUILD",
65
+ # strip_prefix = "libtorch",
66
+ # sha256 = "ea8de17c5f70015583f3a7a43c7a5cdf91a1d4bd19a6a7bc11f074ef6cd69e27",
67
+ # urls = ["https://download.pytorch.org/libtorch/cu102/libtorch-shared-with-deps-1.5.0.zip"],
68
+ # )
69
+
70
+ # Download these tarballs manually from the NVIDIA website
71
+ # Either place them in the distdir directory in third_party and use the --distdir flag
72
+ # or modify the urls to "file:///<PATH TO TARBALL>/<TARBALL NAME>.tar.gz
66
73
67
- # Downloaded distributions to use with --distdir
68
74
#http_archive(
69
75
# name = "cudnn",
70
76
# urls = ["https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.5.32/Production/10.2_20191118/cudnn-10.2-linux-x64-v7.6.5.32.tgz"],
@@ -81,77 +87,61 @@ http_archive(
81
87
# strip_prefix = "TensorRT-7.0.0.11"
82
88
#)
83
89
84
- ## Locally installed dependencies
85
- # new_local_repository(
86
- # name = "cudnn",
87
- # path = "/usr/",
88
- # build_file = "@//third_party/cudnn/local:BUILD"
89
- #)
90
-
91
- # new_local_repository(
92
- # name = "tensorrt",
93
- # path = "/usr/",
94
- # build_file = "@//third_party/tensorrt/local:BUILD"
95
- #)
90
+ ####################################################################################
91
+ # Locally installed dependencies (use in cases of custom dependencies or aarch64)
92
+ ####################################################################################
96
93
97
- git_repository (
98
- name = "googletest" ,
99
- remote = "https://github.com/google/googletest" ,
100
- commit = "703bd9caab50b139428cea1aaff9974ebee5742e" ,
101
- shallow_since = "1570114335 -0400"
102
- )
94
+ # NOTE: In the case you are using just the pre-cxx11-abi path or just the cxx11 abi path
95
+ # with your local libtorch, just point deps at the same path to satisfy bazel.
103
96
97
+ # NOTE: NVIDIA's aarch64 PyTorch (python) wheel file uses the CXX11 ABI unlike PyTorch's standard
98
+ # x86_64 python distribution. If using NVIDIA's version just point to the root of the package
99
+ # for both versions here and do not use --config=pre-cxx11-abi
104
100
105
- ###################################################
106
- # x86_64 libraries
107
- ###################################################
108
101
new_local_repository (
109
- name = "cuda" ,
110
- path = "/usr/local/cuda/targets/x86_64-linux/" ,
111
- build_file = "third_party/libs/cuda.BUILD"
102
+ name = "libtorch" ,
103
+ #path = "/usr/local/lib/python3.6/dist-packages/torch",
104
+ # TODO: Remove this and use the above line before merge into master
105
+ path = "/home/nvidia/.local/lib/python3.6/site-packages/torch" ,
106
+ build_file = "third_party/libtorch/BUILD"
112
107
)
113
108
114
109
new_local_repository (
115
- name = "tensorrt" ,
116
- path = "/usr/local/cuda/targets/x86_64-linux/" ,
117
- build_file = "third_party/libs/tensorrt.BUILD"
110
+ name = "libtorch_pre_cxx11_abi" ,
111
+ #path = "/usr/local/lib/python3.6/dist-packages/torch",
112
+ # TODO: Remove this and use above line before merge into master
113
+ path = "/home/nvidia/.local/lib/python3.6/site-packages/torch" ,
114
+ build_file = "third_party/libtorch/BUILD"
118
115
)
119
116
120
117
new_local_repository (
121
118
name = "cudnn" ,
122
- path = "/usr/local/cuda/targets/x86_64-linux/ " ,
123
- build_file = "third_party/libs/ cudnn. BUILD"
119
+ path = "/usr/" ,
120
+ build_file = "@//third_party/ cudnn/local: BUILD"
124
121
)
125
122
126
- ###################################################
127
- # ARM libraries
128
- ###################################################
129
123
new_local_repository (
130
- name = "cuda_aarch64 " ,
131
- path = "/usr/local/cuda/targets/aarch64-linux-gnu " ,
132
- build_file = "third_party/cuda/ BUILD"
124
+ name = "tensorrt " ,
125
+ path = "/usr/" ,
126
+ build_file = "@// third_party/tensorrt/local: BUILD"
133
127
)
134
128
135
- new_local_repository (
136
- name = "tensorrt_aarch64" ,
137
- path = "/usr" ,
138
- build_file = "third_party/tensorrt/local/BUILD"
139
- )
129
+ #########################################################################
130
+ # Testing Dependencies (optional - comment out on aarch64)
131
+ #########################################################################
140
132
141
- new_local_repository (
142
- name = "cudnn_aarch64" ,
143
- path = "/usr" ,
144
- build_file = "third_party/cudnn/local/BUILD"
145
- )
133
+ #pip3_import(
134
+ # name = "trtorch_py_deps",
135
+ # requirements = "//py:requirements.txt"
136
+ #)
146
137
147
- new_local_repository (
148
- name = "libtorch_pre_cxx11_abi_aarch64" ,
149
- path = "/usr/local/lib/python3.6/dist-packages/torch" ,
150
- build_file = "third_party/libtorch/BUILD"
151
- )
138
+ #load("@trtorch_py_deps//:requirements.bzl", "pip_install")
139
+ #pip_install()
152
140
153
- new_local_repository (
154
- name = "libtorch_aarch64" ,
155
- path = "/usr/local/lib/python3.6/dist-packages/torch" ,
156
- build_file = "third_party/libtorch/BUILD"
157
- )
141
+ #pip3_import(
142
+ # name = "py_test_deps",
143
+ # requirements = "//tests/py:requirements.txt"
144
+ #)
145
+
146
+ #load("@py_test_deps//:requirements.bzl", "pip_install")
147
+ #pip_install()
0 commit comments