Skip to content

Commit

Permalink
download paddle inference for cuda12 in CMAKEList.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
HydrogenSulfate committed Jan 11, 2025
1 parent 2a2fd1b commit af5daeb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ jobs:
- run: |
export LD_LIBRARY_PATH=$CUDA_PATH/lib64:/usr/lib/x86_64-linux-gnu/:$GITHUB_WORKSPACE/dp_test/lib:$GITHUB_WORKSPACE/libtorch/lib:$LD_LIBRARY_PATH
export PATH=$GITHUB_WORKSPACE/dp_test/bin:$PATH
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/paddle/lib/* ${{ github.workspace }}/dp_test/lib/
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* ${{ github.workspace }}/dp_test/lib/
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* ${{ github.workspace }}/dp_test/lib/
python -m pytest -s source/lmp/tests || (cat log.lammps && exit 1)
python -m pytest source/ipi/tests
env:
Expand Down
34 changes: 26 additions & 8 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,35 @@ if(ENABLE_PADDLE)
# message(FATAL_ERROR "Make sure PADDLE_INFERENCE_DIR is set when
# ENABLE_PADDLE=ON")
if(USE_CUDA_TOOLKIT)
message(
STATUS
"PADDLE_INFERENCE_DIR is not defined, downloading GPU infernece lib..."
)
set(DOWNLOAD_URL
"https://paddle-qa.bj.bcebos.com/paddle-pipeline/GITHUB_Docker_Compile_Test_Cuda118_cudnn860_Trt8531_D1/latest/paddle_inference.tgz"
)
find_package(CUDAToolkit REQUIRED)
string(REGEX MATCH "^[0-9]+" CUDA_MAJOR_VERSION "${CUDAToolkit_VERSION}")
message(STATUS "Find CUDAToolkit_VERSION: ${CUDAToolkit_VERSION}")
if(CUDA_MAJOR_VERSION VERSION_EQUAL "11")
message(
STATUS
"PADDLE_INFERENCE_DIR is not defined, downloading CUDA11.8 infernece lib to: ${CMAKE_BINARY_DIR}/"
)
set(DOWNLOAD_URL
"https://paddle-qa.bj.bcebos.com/paddle-pipeline/GITHUB_Docker_Compile_Test_Cuda118_cudnn860_Trt8531_D1/latest/paddle_inference.tgz"
)
elseif(CUDA_MAJOR_VERSION VERSION_EQUAL "12")
message(
STATUS
"PADDLE_INFERENCE_DIR is not defined, downloading CUDA12.3 infernece lib to: ${CMAKE_BINARY_DIR}/"
)
set(DOWNLOAD_URL
"https://paddle-qa.bj.bcebos.com/paddle-pipeline/GITHUB_Docker_Compile_Test_Cuda123_cudnn900_Trt8616_D1/latest/paddle_inference.tgz"
)
else()
message(
FATAL_ERROR
"Paddle inference lib only support cuda 11 or 12, but your CUDA_MAJOR_VERSION is: ${CUDA_MAJOR_VERSION}"
)
endif()
else()
message(
STATUS
"PADDLE_INFERENCE_DIR is not defined, downloading CPU infernece lib..."
"PADDLE_INFERENCE_DIR is not defined, downloading CPU infernece lib to: ${CMAKE_BINARY_DIR}/"
)
set(DOWNLOAD_URL
"https://paddle-qa.bj.bcebos.com/paddle-pipeline/GITHUB_Docker_Compile_Test_Cpu_Mkl_Avx_D1/latest/paddle_inference.tgz"
Expand Down

0 comments on commit af5daeb

Please sign in to comment.