[Rebased] Add linking of static CUDA libs.#201
[Rebased] Add linking of static CUDA libs.#201wsmoses wants to merge 4 commits intogoogle-ml-infra:mainfrom
Conversation
| "libnvptxcompiler": { | ||
| "repo_name": "cuda_nvptxcompiler", | ||
| "version_to_template": { | ||
| "13": "//gpu/cuda/build_templates:cuda_nvptxcompiler.BUILD.tpl", |
There was a problem hiding this comment.
What about CUDA 12? Can we use the same template?
| "cuda_culibos": { | ||
| "repo_name": "cuda_culibos", | ||
| "version_to_template": { | ||
| "13": "//gpu/cuda/build_templates:cuda_culibos.BUILD.tpl", |
There was a problem hiding this comment.
we need key-value for CUDA 12 as well.
| load("@cuda_nvml//:version.bzl", _nvml_version = "VERSION") | ||
| load("@cuda_nvtx//:version.bzl", _nvtx_version = "VERSION") | ||
| load("@cuda_nvvm//:version.bzl", _nvvm_version = "VERSION") | ||
| load("@cuda_nvptxcompiler//:version.bzl", _cuda_nvptxcompiler_version = "VERSION") |
There was a problem hiding this comment.
Please add the load for cuda_culibos version to speed up the creation of repositories.
| nvccopts += std_options | ||
| nvccopts += m_options | ||
| nvccopts += warning_options | ||
| # nvccopts += ' -rdc=true ' |
There was a problem hiding this comment.
If this line is not needed, please remove it.
| # Unfortunately, there are other options that have -c prefix too. | ||
| # So allowing only those look like C/C++ files. | ||
| src_files = [f for f in src_files if | ||
| re.search(r'\.cpp$|\.cc$|\.c$|\.cxx$|\.C$|\.cu$', f)] |
There was a problem hiding this comment.
I assume this change is not needed.
| %{multiline_comment} | ||
| cc_import( | ||
| name = "nvptxcompiler_static_library", | ||
| hdrs = ["include/nvPTXCompiler.h"], |
There was a problem hiding this comment.
you need to create a filegroup with the headers and then cc_library depending on this group - see example here
| %{comment}":cudnn_engines_precompiled", | ||
| %{comment}alwayslink = if_static_cudnn(True, False), | ||
| %{comment}srcs = if_static_cudnn( | ||
| %{comment}[":lib/libcudnn_engines_precompiled_static_v9.a", |
There was a problem hiding this comment.
I think the suffix "v9" is specific for a particular CUDNN version. Other CUDNN version might have different suffixes. I suspect we need %{libcudnn_version} here.
Also I see that you've added cc_import for static libs (like cudnn_engines_precompiled_static), but you don't use them anywhere. Do you want to add them to srcs instead of the file targets?
No description provided.