Файл рабочей области:
Код: Выделить всё
local_repository(
name = "cuda",
path = "/usr/local/cuda-12.6", # Adjust this path to your CUDA installation
)
Код: Выделить всё
cc_library(
name = "cuda_headers",
hdrs = glob(["cuda/targets/x86_64-linux/include/**/*.h"]), # Matches all .h files at any depth
includes = ["cuda/targets/x86_64-linux/include"], # Specify the include directory
visibility = ["//visibility:public"], # Adjust visibility as needed
)
cc_library(
name = "tensorrt_llm",
srcs = ["libs/libtensorrt_llm.so"],
hdrs = glob(["include/**/*.h"]),
includes = ["include"],
deps = ["cuda_headers"],
)
cc_library(
name = "nvinfer_plugin_tensorrt_llm",
srcs = ["libs/libnvinfer_plugin_tensorrt_llm.so"],
hdrs = glob(["include/**/*.h"]),
# includes = ["include"],
)
# BUILD file
cc_binary(
name = "executorExampleBasic",
srcs = ["executorExampleBasic.cpp"],
includes = ["include"],
deps = [":nvinfer_plugin_tensorrt_llm", ":cuda_headers"], # Assuming nvinfer_plugin_tensorrt_llm is in the same package
copts = ["-DENABLE_BF16", "-DENABLE_FP8", "-lcudart_static", "-lcuda_nvml", "-lcuda_driver", ],
)
Код: Выделить всё
#include
Итак, мой вопрос: правильный ли метод, который я использую для включения заголовков cuda? Если да, то почему Базель до сих пор не может найти cuda_bf16.h?
Подробнее здесь: https://stackoverflow.com/questions/793 ... t-by-bazel