Skip to content

Commit

Permalink
Add nvrtc to setup scripts. (#11335)
Browse files Browse the repository at this point in the history
Summary:
#11225 requires CUDA's nvrtc library  and the cuda driver stubs (on machines without a gpu) to be available.

* Install nvrct and stubs in centos and ubuntu scripts
* Turn GPU build back on.
* Add missing links and remove some superflous ones
* Turn all targets that link directly or indirectly against CUDA::cuda_driver into standalone targets as the stubbed symbols will throw a dload error on the gpu less runner. This way we keep them out of the mono library and avoid throwing errors in non-gpu tests.
* Exclude tests that use the cuda driver stubs via label

Pull Request resolved: #11335

Reviewed By: Yuhta

Differential Revision: D65067732

Pulled By: pedroerp

fbshipit-source-id: 4e33222659cf196ca0869ec98c5f35f7a27ee7da
  • Loading branch information
assignUser authored and facebook-github-bot committed Oct 28, 2024
1 parent 4a43b02 commit 33b68aa
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
"-DVELOX_ENABLE_GCS=ON"
"-DVELOX_ENABLE_ABFS=ON"
"-DVELOX_ENABLE_REMOTE_FUNCTIONS=ON"
"-DVELOX_ENABLE_GPU=OFF"
"-DVELOX_ENABLE_GPU=ON"
"-DVELOX_MONO_LIBRARY=ON"
)
make release EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS[*]}"
Expand All @@ -136,7 +136,7 @@ jobs:
working-directory: _build/release
run: |
export CLASSPATH=`/usr/local/hadoop/bin/hdfs classpath --glob`
ctest -j 8 --output-on-failure --no-tests=error
ctest -j 8 --label-exclude cuda_driver --output-on-failure --no-tests=error
ubuntu-debug:
runs-on: 8-core-ubuntu
Expand Down
3 changes: 2 additions & 1 deletion scripts/setup-centos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ function install_arrow {
function install_cuda {
# See https://developer.nvidia.com/cuda-downloads
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo
dnf install -y cuda-nvcc-$(echo $1 | tr '.' '-') cuda-cudart-devel-$(echo $1 | tr '.' '-')
local dashed="$(echo $1 | tr '.' '-')"
dnf install -y cuda-nvcc-$dashed cuda-cudart-devel-$dashed cuda-nvrtc-devel-$dashed cuda-driver-devel-$dashed
}

function install_velox_deps {
Expand Down
3 changes: 2 additions & 1 deletion scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ function install_cuda {
rm cuda-keyring_1.1-1_all.deb
$SUDO apt update
fi
$SUDO apt install -y cuda-nvcc-$(echo $1 | tr '.' '-') cuda-cudart-dev-$(echo $1 | tr '.' '-')
local dashed="$(echo $1 | tr '.' '-')"
$SUDO apt install -y cuda-nvcc-$dashed cuda-cudart-dev-$dashed cuda-nvrtc-dev-$dashed cuda-driver-dev-$dashed
}

function install_velox_deps {
Expand Down
6 changes: 4 additions & 2 deletions velox/experimental/wave/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

velox_add_library(
add_library(
velox_wave_common
GpuArena.cpp
Buffer.cpp
Expand All @@ -23,11 +23,13 @@ velox_add_library(
Type.cpp
ResultStaging.cpp)

velox_link_libraries(
target_link_libraries(
velox_wave_common
velox_exception
velox_common_base
velox_type
CUDA::cuda_driver
CUDA::cudart
CUDA::nvrtc)

if(${VELOX_BUILD_TESTING})
Expand Down
9 changes: 2 additions & 7 deletions velox/experimental/wave/common/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ add_executable(
HashTestUtil.cpp)

add_test(velox_wave_common_test velox_wave_common_test)
set_tests_properties(velox_wave_common_test PROPERTIES LABELS cuda_driver)

target_link_libraries(
velox_wave_common_test
velox_wave_common
velox_memory
velox_time
velox_exception
GTest::gtest
GTest::gtest_main
gflags::gflags
glog::glog
Folly::folly
CUDA::nvrtc)
CUDA::cudart)
5 changes: 3 additions & 2 deletions velox/experimental/wave/dwio/decode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

add_subdirectory(tests)

velox_add_library(velox_wave_decode GpuDecoder.cu)
add_library(velox_wave_decode GpuDecoder.cu)

velox_link_libraries(velox_wave_decode velox_wave_common)
target_link_libraries(
velox_wave_decode velox_wave_common)
7 changes: 2 additions & 5 deletions velox/experimental/wave/dwio/decode/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@
add_executable(velox_wave_decode_test GpuDecoderTest.cu)

add_test(velox_wave_decode_test velox_wave_decode_test)
set_tests_properties(velox_wave_decode_test PROPERTIES LABELS cuda_driver)

target_link_libraries(
velox_wave_decode_test
velox_wave_decode
velox_wave_common
velox_memory
velox_time
velox_exception
GTest::gtest
GTest::gtest_main
gflags::gflags
glog::glog
Folly::folly
CUDA::nvrtc)
fmt::fmt)
9 changes: 5 additions & 4 deletions velox/experimental/wave/exec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

velox_add_library(velox_wave_stream OperandSet.cpp Wave.cpp)
add_library(velox_wave_stream OperandSet.cpp Wave.cpp)

velox_link_libraries(velox_wave_stream Folly::folly fmt::fmt xsimd)
target_link_libraries(
velox_wave_stream Folly::folly fmt::fmt xsimd)

velox_add_library(
add_library(
velox_wave_exec
Aggregation.cpp
AggregationInstructions.cu
Expand All @@ -34,7 +35,7 @@ velox_add_library(
WaveHiveDataSource.cpp
WaveSplitReader.cpp)

velox_link_libraries(
target_link_libraries(
velox_wave_exec
velox_wave_vector
velox_wave_common
Expand Down
35 changes: 9 additions & 26 deletions velox/experimental/wave/exec/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,17 @@ target_link_libraries(
velox_type
velox_vector
velox_vector_fuzzer
Boost::atomic
Boost::context
Boost::date_time
Boost::filesystem
Boost::program_options
Boost::regex
Boost::thread
Boost::system
gtest
gtest_main
gmock
GTest::gtest
GTest::gtest_main
GTest::gmock
Folly::folly
gflags::gflags
glog::glog
fmt::fmt
${FILESYSTEM}
CUDA::nvrtc)
CUDA::cudart)

add_test(velox_wave_exec_test velox_wave_exec_test)
set_tests_properties(velox_wave_exec_test PROPERTIES LABELS cuda_driver)

if(${VELOX_ENABLE_BENCHMARKS})
add_executable(velox_wave_benchmark WaveBenchmark.cpp)
Expand Down Expand Up @@ -87,22 +79,13 @@ if(${VELOX_ENABLE_BENCHMARKS})
velox_type
velox_vector
velox_vector_fuzzer
Boost::atomic
Boost::context
Boost::date_time
Boost::filesystem
Boost::program_options
Boost::regex
Boost::thread
Boost::system
gtest
gtest_main
gmock
GTest::gtest
GTest::gtest_main
GTest::gmock
${FOLLY_BENCHMARK}
Folly::folly
gflags::gflags
glog::glog
fmt::fmt
${FILESYSTEM}
CUDA::nvrtc)
CUDA::cudart)
endif()
2 changes: 1 addition & 1 deletion velox/experimental/wave/vector/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

add_executable(velox_wave_vector_test VectorTest.cpp)

add_test(veloxwave__vector_test velox_wave_vector_test)
add_test(veloxwave_vector_test velox_wave_vector_test)

target_link_libraries(
velox_wave_vector_test
Expand Down

0 comments on commit 33b68aa

Please sign in to comment.