From 59adc57e8cbf9ef8b84d70896693cec906fd03be Mon Sep 17 00:00:00 2001 From: Matthew Kotila Date: Fri, 25 Oct 2024 12:20:13 -0700 Subject: [PATCH] Fix cuda linking bug --- src/c++/examples/CMakeLists.txt | 6 +++--- src/c++/library/CMakeLists.txt | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/c++/examples/CMakeLists.txt b/src/c++/examples/CMakeLists.txt index c1fe4f9fc..fb0625a05 100644 --- a/src/c++/examples/CMakeLists.txt +++ b/src/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2020-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -271,7 +271,7 @@ if(TRITON_ENABLE_CC_GRPC) simple_grpc_cudashm_client PRIVATE grpcclient_static - ${CUDA_LIBRARIES} + CUDA::cudart ) install( TARGETS simple_grpc_cudashm_client @@ -409,7 +409,7 @@ if(TRITON_ENABLE_CC_HTTP) simple_http_cudashm_client PRIVATE httpclient_static - ${CUDA_LIBRARIES} + CUDA::cudart ) install( TARGETS simple_http_cudashm_client diff --git a/src/c++/library/CMakeLists.txt b/src/c++/library/CMakeLists.txt index b5656bfaf..7fa1ca9f7 100644 --- a/src/c++/library/CMakeLists.txt +++ b/src/c++/library/CMakeLists.txt @@ -291,10 +291,8 @@ if(TRITON_ENABLE_CC_GRPC) endif() # TRITON_ENABLE_GPU if(TRITON_ENABLE_GPU) - target_link_libraries( - ${_client_target} - PUBLIC CUDA::cudart - ) + target_include_directories(${_client_target} + PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) endif() # TRITON_ENABLE_GPU endforeach() @@ -477,10 +475,8 @@ if(TRITON_ENABLE_CC_HTTP) endif() # TRITON_ENABLE_GPU if(TRITON_ENABLE_GPU) - target_link_libraries( - ${_client_target} - PUBLIC CUDA::cudart - ) + target_include_directories(${_client_target} + PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) endif() # TRITON_ENABLE_GPU if(${TRITON_ENABLE_ZLIB})