Skip to content
Snippets Groups Projects
Commit d5650609 authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

fix : pip do not packs cuda* .so files in .whl, aidge_backend_cuda pkg wieghs now ~2Mo max

CUDA*  libs are now private deps
Set official version of these libraries
CUDA Toolkit :  12.4
CUDNN : 9
auditwheel repair call has been removed from CIBuildWheel call to forbid it to pack the cuda .so files within the wheel
Closes #32
parent 2cc7de11
No related branches found
No related tags found
1 merge request!46fix : cuda wheel too big
...@@ -40,9 +40,10 @@ release:pip:ubuntu: ...@@ -40,9 +40,10 @@ release:pip:ubuntu:
DOCKER_HOST='unix:///var/run/docker.sock' DOCKER_HOST='unix:///var/run/docker.sock'
ARCH='x86_64' ARCH='x86_64'
CUDNN_VERSION='9' CUDNN_VERSION='9'
CUDA_MAJOR_VERSION='11' CUDA_MAJOR_VERSION='12'
CUDA_MINOR_VERSION='8' CUDA_MINOR_VERSION='4'
SEARCH_PATH='/home/ubuntu/builds/$CI_RUNNER_SHORT_TOKEN/$CI_CONCURRENT_ID' SEARCH_PATH='/home/ubuntu/builds/$CI_RUNNER_SHORT_TOKEN/$CI_CONCURRENT_ID'
CIBW_REPAIR_WHEEL_COMMAND=''
parallel: parallel:
matrix: matrix:
......
...@@ -67,7 +67,7 @@ if(NOT $ENV{AIDGE_INSTALL} STREQUAL "") ...@@ -67,7 +67,7 @@ if(NOT $ENV{AIDGE_INSTALL} STREQUAL "")
list(APPEND ENV{PATH} /usr/local/cuda/bin) list(APPEND ENV{PATH} /usr/local/cuda/bin)
set(ENV{CUDACXX} /usr/local/cuda/bin/nvcc) set(ENV{CUDACXX} /usr/local/cuda/bin/nvcc)
endif() endif()
find_package(CUDAToolkit REQUIRED) find_package(CUDAToolkit 12 REQUIRED)
if(NOT DEFINED CMAKE_CUDA_STANDARD) if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD 14) set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON) set(CMAKE_CUDA_STANDARD_REQUIRED ON)
...@@ -97,7 +97,7 @@ if (PYBIND) ...@@ -97,7 +97,7 @@ if (PYBIND)
# Handles Python + pybind11 headers dependencies # Handles Python + pybind11 headers dependencies
include(PybindModuleCreation) include(PybindModuleCreation)
# creates a target of the same name as CMAKE_PROJECT_NAME # creates a target of the same name as CMAKE_PROJECT_NAME
generate_python_binding(${CMAKE_PROJECT_NAME} ${module_name}) # the python bindings module has the same name as the project. generate_python_binding(${CMAKE_PROJECT_NAME} ${module_name}) # the python bindings module has the same name as the project.
target_link_libraries(${module_name} target_link_libraries(${module_name}
PUBLIC PUBLIC
...@@ -110,9 +110,10 @@ endif() ...@@ -110,9 +110,10 @@ endif()
target_link_libraries(${module_name} target_link_libraries(${module_name}
PUBLIC PUBLIC
_aidge_core # _ is added because we link the target not the project _aidge_core # _ is added because we link the target not the project
CUDA::cudart PRIVATE
CUDA::cublas CUDA::cublas
cudnn cudnn
CUDA::cudart
) )
if( ${ENABLE_ASAN} ) if( ${ENABLE_ASAN} )
......
...@@ -8,6 +8,8 @@ You can find in this folder the library that implements the CUDA operators. ...@@ -8,6 +8,8 @@ You can find in this folder the library that implements the CUDA operators.
## Installation ## Installation
### Dependencies ### Dependencies
- [CUDA ToolKit 12.4](https://developer.nvidia.com/cuda-12-4-0-download-archive)
- [CUDnn9](https://developer.nvidia.com/cudnn-downloads) make sure to install the CUDA 12 compatible version
- `GCC` - `GCC`
- `Make`/`Ninja` - `Make`/`Ninja`
- `CMake` - `CMake`
......
...@@ -20,6 +20,18 @@ function(generate_python_binding pybind_module_name target_to_bind) ...@@ -20,6 +20,18 @@ function(generate_python_binding pybind_module_name target_to_bind)
file(GLOB_RECURSE pybind_src_files "python_binding/*.cpp") file(GLOB_RECURSE pybind_src_files "python_binding/*.cpp")
pybind11_add_module(${pybind_module_name} MODULE ${pybind_src_files} "NO_EXTRAS") # NO EXTRA recquired for pip install pybind11_add_module(${pybind_module_name} MODULE ${pybind_src_files} "NO_EXTRAS") # NO EXTRA recquired for pip install
target_include_directories(${pybind_module_name} PUBLIC "python_binding") target_include_directories(${pybind_module_name} PRIVATE "python_binding")
target_link_libraries(${pybind_module_name} PUBLIC ${target_to_bind}) target_link_libraries(${pybind_module_name}
PRIVATE
${target_to_bind}
CUDA::cublas
cudnn
CUDA::cudart
)
set_property(TARGET ${pybind_module_name} PROPERTY POSITION_INDEPENDENT_CODE ON)
set_target_properties(${pybind_module_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_target_properties(${pybind_module_name} PROPERTIES
CMAKE_SHARED_LINKER_FLAGS "-Wl,--exclude-libs,ALL"
)
set_target_properties(${module} PROPERTIES INSTALL_RPATH "")
endfunction() endfunction()
...@@ -47,6 +47,8 @@ test-command = "pytest {project}/aidge_backend_cuda/unit_tests" ...@@ -47,6 +47,8 @@ test-command = "pytest {project}/aidge_backend_cuda/unit_tests"
# "cp310-manylinux_x86_64" # "cp310-manylinux_x86_64"
# ] # ]
repair-wheel-command = ""
[tool.cibuildwheel.container-engine] [tool.cibuildwheel.container-engine]
# pass command line options to 'docker run' # pass command line options to 'docker run'
name = "docker" name = "docker"
...@@ -66,8 +68,8 @@ AIDGE_DEPENDENCIES = "aidge_core aidge_backend_cpu" # format => "dep_1 dep_2 ... ...@@ -66,8 +68,8 @@ AIDGE_DEPENDENCIES = "aidge_core aidge_backend_cpu" # format => "dep_1 dep_2 ...
AIDGE_INSTALL="/AIDGE_INSTALL_CIBUILDWHEEL" AIDGE_INSTALL="/AIDGE_INSTALL_CIBUILDWHEEL"
ARCH="x86_64" ARCH="x86_64"
CUDNN_VERSION="9" CUDNN_VERSION="9"
CUDA_MAJOR_VERSION="11" CUDA_MAJOR_VERSION="12"
CUDA_MINOR_VERSION="8" CUDA_MINOR_VERSION="4"
DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_HOST="unix:///var/run/docker.sock"
SEARCH_PATH="/home/ubuntu/aidge/aidge" # debug path SEARCH_PATH="/home/ubuntu/aidge/aidge" # debug path
# these two following variables are set within CMakeLists.txt when calling cibuildwheel from CI # these two following variables are set within CMakeLists.txt when calling cibuildwheel from CI
......
...@@ -16,7 +16,14 @@ add_executable(tests${module_name} ${src_files}) ...@@ -16,7 +16,14 @@ add_executable(tests${module_name} ${src_files})
target_link_libraries(tests${module_name} PUBLIC ${module_name}) target_link_libraries(tests${module_name} PUBLIC ${module_name})
target_link_libraries(tests${module_name} PRIVATE Catch2::Catch2WithMain) target_link_libraries(tests${module_name}
PRIVATE
Catch2::Catch2WithMain
CUDA::cudart
cudnn
CUDA::cublas
)
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
include(CTest) include(CTest)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment