Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ci/build_wheel_cuopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ set -euo pipefail

source rapids-init-pip

# Install cudss
bash ci/utils/install_cudss.sh

package_dir="python/cuopt"
export SKBUILD_CMAKE_ARGS="-DCUOPT_BUILD_WHEELS=ON;-DDISABLE_DEPRECATION_WARNINGS=ON";

Expand Down
19 changes: 19 additions & 0 deletions ci/build_wheel_libcuopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ else
echo "Building in release mode"
fi

# Install cudss
bash ci/utils/install_cudss.sh

# Clean metadata & install cudss
if command -v dnf &> /dev/null; then
dnf clean all
# Adding static library just to please CMAKE requirements
dnf -y install libcudss0-static-cuda-12 libcudss0-devel-cuda-12 libcudss0-cuda-12
elif command -v apt-get &> /dev/null; then
apt-get update
apt-get install -y libcudss-devel
else
echo "Neither dnf nor apt-get found. Cannot install cudss dependencies."
exit 1
fi
# dnf -y install libcudss0-devel-cuda-12


rapids-logger "Generating build requirements"

CUOPT_MPS_PARSER_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_mps_parser" rapids-download-wheels-from-github python)
Expand Down Expand Up @@ -62,6 +80,7 @@ EXCLUDE_ARGS=(
--exclude "libraft.so"
--exclude "libcublas.so.*"
--exclude "libcublasLt.so.*"
--exclude "libcudss.so.*"
--exclude "libcurand.so.*"
--exclude "libcusolver.so.*"
--exclude "libcusparse.so.*"
Expand Down
40 changes: 40 additions & 0 deletions ci/utils/install_cudss.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euo pipefail

# Clean metadata & install cudss
if command -v dnf &> /dev/null; then
dnf clean all
# Adding static library just to please CMAKE requirements
dnf -y install libcudss0-static-cuda-12 libcudss0-devel-cuda-12 libcudss0-cuda-12
elif command -v apt-get &> /dev/null; then
apt-get update
apt-get install -y libcudss-devel
else
echo "Neither dnf nor apt-get found. Cannot install cudss dependencies."
exit 1
fi









1 change: 1 addition & 0 deletions conda/environments/all_cuda-128_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies:
- httpx
- ipython
- jsonref==1.1.0
- libcudss-dev
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-128_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies:
- httpx
- ipython
- jsonref==1.1.0
- libcudss-dev
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
Expand Down
3 changes: 3 additions & 0 deletions conda/recipes/libcuopt/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ cache:
- librmm =${{ dep_minor_version }}
- rapids-logger =0.1
- cuda-nvtx-dev
- libcudss-dev
- libcurand-dev
- libcusparse-dev
- cuda-cudart-dev
Expand Down Expand Up @@ -133,6 +134,7 @@ outputs:
- rapids-logger =0.1
- librmm =${{ dep_minor_version }}
- cuda-cudart-dev
- libcudss-dev
- libcublas
- libcusparse-dev
run:
Expand Down Expand Up @@ -183,6 +185,7 @@ outputs:
- gmock ${{ gtest_version }}
- gtest ${{ gtest_version }}
- cuda-cudart-dev
- libcudss-dev
- libcublas
- libcusparse-dev
run:
Expand Down
18 changes: 18 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,23 @@ list(PREPEND CUOPT_PRIVATE_CUDA_LIBS CUDA::cublasLt)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libmps_parser)
set(CMAKE_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/libmps_parser/)

find_package(cudss REQUIRED CONFIG)

# Print all details of the cudss package
message(STATUS "cudss package details:")
message(STATUS " cudss_FOUND: ${cudss_FOUND}")
message(STATUS " cudss_VERSION: ${cudss_VERSION}")
message(STATUS " cudss_INCLUDE_DIRS: ${cudss_INCLUDE_DIRS}")
message(STATUS " cudss_LIBRARY_DIR: ${cudss_LIBRARY_DIR}")
message(STATUS " cudss_LIBRARIES: ${cudss_LIBRARIES}")
message(STATUS " cudss_DEFINITIONS: ${cudss_DEFINITIONS}")
message(STATUS " cudss_COMPILE_OPTIONS: ${cudss_COMPILE_OPTIONS}")
message(STATUS " cudss_LINK_OPTIONS: ${cudss_LINK_OPTIONS}")

# Use the specific cudss library version to avoid symlink issues
set(CUDSS_LIB_FILE "${cudss_LIBRARY_DIR}/libcudss.so.0")
message(STATUS "Using cudss library: ${CUDSS_LIB_FILE}")


target_link_libraries(cuopt
PUBLIC
Expand All @@ -260,6 +277,7 @@ target_link_libraries(cuopt
CCCL::CCCL
raft::raft
cuopt::mps_parser
${CUDSS_LIB_FILE}
PRIVATE
${CUOPT_PRIVATE_CUDA_LIBS}
)
Expand Down
10 changes: 10 additions & 0 deletions cpp/src/mip/solver.cu
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,25 @@
#include <raft/sparse/detail/cusparse_macros.h>
#include <raft/sparse/detail/cusparse_wrappers.h>

#include <cudss.h>

#include <future>
#include <memory>
#include <thread>

namespace cuopt::linear_programming::detail {

void force_link_cudss()
{
cudssHandle_t handle;
cudssCreate(&handle);
cudssDestroy(handle);
}

// This serves as both a warm up but also a mandatory initial call to setup cuSparse and cuBLAS
static void init_handler(const raft::handle_t* handle_ptr)
{
force_link_cudss();
// Init cuBlas / cuSparse context here to avoid having it during solving time
RAFT_CUBLAS_TRY(raft::linalg::detail::cublassetpointermode(
handle_ptr->get_cublas_handle(), CUBLAS_POINTER_MODE_DEVICE, handle_ptr->get_stream()));
Expand Down
4 changes: 4 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -691,13 +691,15 @@ dependencies:
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
- libcudss-dev
- cuda-nvtx-dev
- matrix:
cuda: "12.*"
packages:
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
- libcudss-dev
- cuda-nvtx-dev
- cuda-nvvm
- cuda-crt
Expand All @@ -714,6 +716,7 @@ dependencies:
- nvidia-curand-cu12
- nvidia-cusparse-cu12
- nvidia-cusolver-cu12
- nvidia-cudss-cu12
- nvidia-nvtx-cu12
# if use_cuda_wheels=false is provided, do not add dependencies on any CUDA wheels
# (e.g. for DLFW and pip devcontainers)
Expand All @@ -728,6 +731,7 @@ dependencies:
- nvidia-curand
- nvidia-cusparse
- nvidia-cusolver
- nvidia-cudss
- nvidia-nvtx
develop:
common:
Expand Down
1 change: 1 addition & 0 deletions python/libcuopt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ set(rpaths
"$ORIGIN/../../rapids_logger/lib64"
"$ORIGIN/../../librmm/lib64"
"$ORIGIN/../../nvidia/cublas/lib"
"$ORIGIN/../../nvidia/cu12/lib"
"$ORIGIN/../../nvidia/curand/lib"
"$ORIGIN/../../nvidia/cusolver/lib"
"$ORIGIN/../../nvidia/cusparse/lib"
Expand Down
2 changes: 2 additions & 0 deletions python/libcuopt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dependencies = [
"cuopt-mps-parser==25.10.*,>=0.0.0a0",
"librmm==25.10.*,>=0.0.0a0",
"nvidia-cublas",
"nvidia-cudss",
"nvidia-curand",
"nvidia-cusolver",
"nvidia-cusparse",
Expand All @@ -64,6 +65,7 @@ libcuopt = "libcuopt"
select = [
"distro-too-large-compressed",
]

max_allowed_size_compressed = '775M'

[project.scripts]
Expand Down
Loading