Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
318c1da
[hipblaslt] Deprecate hipconfig: read ROCm version without hipconfig
david-salinas May 9, 2026
3b045a6
[rocBLAS/shared-tensile] Deprecate hipconfig: read ROCm version witho…
david-salinas May 9, 2026
1195086
[rocBLAS/shared-tensile] Continue deprecating hipconfig
accauble Jun 9, 2026
54f5b2d
[hipblaslt] Continue deprecating hipconfig
accauble Jun 9, 2026
2a432dc
[rocBLAS/shared-tensile] Changes to appease linter
accauble Jun 9, 2026
08bf9ca
[hipblaslt][tensilelite] Remove supportedHip from characterization tests
david-salinas Aug 27, 2026
c87aef8
[hipblaslt][tensilelite] Add rocm_sdk pip fallback for ROCm version d…
david-salinas Aug 28, 2026
933ffdf
[hipblaslt][tensilelite] Prioritize pip rocm_sdk version over system …
david-salinas Aug 28, 2026
841c690
[hipblaslt][tensilelite] Fix test mocks after HIP_CONFIG removal from…
david-salinas Aug 31, 2026
4e7d81d
[hipblaslt][tensilelite] Replace hipconfig version tests with new beh…
david-salinas Aug 31, 2026
8ea8de3
[hipblas][hipsolver] Replace hipconfig --platform with hardcoded 'amd'
david-salinas Aug 31, 2026
955cc91
[hipblaslt][tensilelite] Update coverage baseline for Component.py
david-salinas Aug 31, 2026
35d69d8
[hipblas] Fix HIP_PLATFORM override when --cuda flag is used
david-salinas Aug 31, 2026
b326b11
Address review feedback from Alex-Vasile on hipconfig deprecation PR
david-salinas Sep 1, 2026
adacc32
[hipblas] Remove hipcc dependency from CUDA backend build path
david-salinas Sep 1, 2026
793d9cf
[hipblas] Replace HIP_PLATFORM env var with USE_CUDA CMake option
david-salinas Sep 2, 2026
dd5a884
fix(hipblas): complete explicit backend configuration
newling Sep 2, 2026
c55c523
fix(tensile): preserve ROCm version detection coverage
newling Sep 2, 2026
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
48 changes: 18 additions & 30 deletions projects/hipblas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,37 +77,25 @@ endif( )
# BUILD_SHARED_LIBS is a cmake built-in; we make it an explicit option such that it shows in cmake-gui
option( BUILD_SHARED_LIBS "Build hipBLAS as a shared library" ON )

# Deprecated USE_CUDA option
if(DEFINED USE_CUDA)
if(USE_CUDA)
set(ENV{HIP_PLATFORM} nvidia)
message(DEPRECATED "USE_CUDA is deprecated (use environment variable HIP_PLATFORM=nvidia)")
else()
set(ENV{HIP_PLATFORM} amd)
message(DEPRECATION "USE_CUDA is deprecated (use environment variable HIP_PLATFORM=amd)")
endif()
endif()

# Hip headers required of all clients; clients use hip to allocate device memory
find_package( hip CONFIG PATHS ${HIP_DIR} ${ROCM_PATH} /opt/rocm )

# support for cuda backend with hip < 6.0
if(NOT hip_FOUND)
find_package( HIP MODULE REQUIRED )
list( APPEND HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include" )
set(ENV{HIP_PLATFORM} nvidia)
if (NOT HIP_PLATFORM)
set(HIP_PLATFORM nvidia)
endif()
# USE_CUDA: build hipBLAS for the CUDA backend using nvcc directly.
# Pass -DUSE_CUDA=ON to cmake (or --cuda to rmake.py/install.sh) to enable.
option(USE_CUDA "Build hipBLAS for the CUDA backend using nvcc directly" OFF)

# Define the platform before loading HIP's CMake package so it does not need to
# invoke hipconfig to select a backend. The HIP headers and hip::host target are
# required by the public hipBLAS headers on both backends.
if(USE_CUDA)
set(HIP_PLATFORM nvidia)
else()
if (NOT HIP_PLATFORM)
set(HIP_PLATFORM amd)
endif()
set(HIP_PLATFORM amd)
endif()
find_package(hip CONFIG REQUIRED PATHS ${HIP_DIR} ${ROCM_PATH} /opt/rocm)

if(HIP_PLATFORM STREQUAL nvidia)
find_package( CUDA REQUIRED )
set( HIPBLAS_HIP_PLATFORM_COMPILER_DEFINES __HIP_PLATFORM_NVCC__ __HIP_PLATFORM_NVIDIA__ )
if(USE_CUDA)
# CUDA backend: use the CUDAToolkit module (requires nvcc on PATH or
# CMAKE_CUDA_COMPILER set by the caller). No hipcc involvement.
find_package(CUDAToolkit REQUIRED)
set(HIPBLAS_CUDA_COMPILER_DEFINES __HIP_PLATFORM_NVCC__ __HIP_PLATFORM_NVIDIA__)
endif()

option(BUILD_CODE_COVERAGE "Build with code coverage enabled" OFF)
Expand Down Expand Up @@ -198,7 +186,7 @@ if( WIN32 )
endif( )

# Package specific CPACK vars
if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
set(rocblas_minimum 5.7.0)
set(rocsolver_minimum 3.33.0)
rocm_package_add_dependencies(SHARED_DEPENDS "rocblas >= ${rocblas_minimum}" "rocsolver >= ${rocsolver_minimum}")
Expand Down Expand Up @@ -237,7 +225,7 @@ endif( )
set( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "\${CPACK_PACKAGING_INSTALL_PREFIX}" )

# Give hipblas compiled for CUDA backend a different name
if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
set( package_name hipblas )
else( )
set( package_name hipblas-alt )
Expand Down
2 changes: 1 addition & 1 deletion projects/hipblas/clients/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ if( BUILD_CLIENTS_BENCHMARKS OR BUILD_CLIENTS_TESTS)
list( APPEND COMMON_LINK_LIBS "Threads::Threads")
endif()

set( COMMON_DEFINES HIPBLAS_USE_HIP_HALF HIPBLAS_BFLOAT16_CLASS ROCM_USE_FLOAT16 HIPBLAS_NO_DEPRECATED_WARNINGS ${HIPBLAS_HIP_PLATFORM_COMPILER_DEFINES} )
set( COMMON_DEFINES HIPBLAS_USE_HIP_HALF HIPBLAS_BFLOAT16_CLASS ROCM_USE_FLOAT16 HIPBLAS_NO_DEPRECATED_WARNINGS ${HIPBLAS_CUDA_COMPILER_DEFINES} )
if (BUILD_FORTRAN_CLIENTS)
list( APPEND COMMON_DEFINES "HIPBLAS_FORTRAN_CLIENTS" )
endif()
Expand Down
9 changes: 2 additions & 7 deletions projects/hipblas/clients/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,15 @@ if (NOT WIN32)
target_link_libraries( hipblas-bench PRIVATE stdc++fs )
endif()

if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
target_link_libraries( hipblas-bench PRIVATE hip::host )

if( CUSTOM_TARGET )
target_link_libraries( hipblas-bench PRIVATE hip::${CUSTOM_TARGET} )
endif()

else( )
target_include_directories( hipblas-bench
PRIVATE
$<BUILD_INTERFACE:${CUDA_INCLUDE_DIRS}>
)

target_link_libraries( hipblas-bench PRIVATE ${CUDA_LIBRARIES} )
target_link_libraries( hipblas-bench PRIVATE hip::host CUDA::cudart )
endif( )

set_target_properties( hipblas-bench PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion projects/hipblas/clients/cmake/build-options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if( NOT CREATE_TEST_APP_LOCAL_DEPLOY )
option( CREATE_TEST_APP_LOCAL_DEPLOY "Create test sandbox for app local deployment" OFF )
endif( )

if( HIP_PLATFORM STREQUAL nvidia )
if( USE_CUDA )
option( LINK_BLIS "Link AOCL Blis reference library" OFF )
else()
option( LINK_BLIS "Link AOCL Blis reference library" ON )
Expand Down
9 changes: 2 additions & 7 deletions projects/hipblas/clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,15 @@ if (NOT WIN32)
target_link_libraries( hipblas-test PRIVATE stdc++fs )
endif()

if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
target_link_libraries( hipblas-test PRIVATE hip::host )

if( CUSTOM_TARGET )
target_link_libraries( hipblas-test PRIVATE hip::${CUSTOM_TARGET} )
endif( )

else( )
target_include_directories( hipblas-test
PRIVATE
$<BUILD_INTERFACE:${CUDA_INCLUDE_DIRS}>
)

target_link_libraries( hipblas-test PRIVATE ${CUDA_LIBRARIES} )
target_link_libraries( hipblas-test PRIVATE hip::host CUDA::cudart )
endif( )

if (CREATE_TEST_APP_LOCAL_DEPLOY AND WIN32)
Expand Down
16 changes: 5 additions & 11 deletions projects/hipblas/clients/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if(NOT WIN32)
set( sample_list_fortran hipblas-example-sscal-fortran hipblas-example-gemmEx-fortran )
endif()

if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
add_executable(hipblas-example-bfdot-hip-bfloat16 example_bfdot_hip_bfloat16.cpp ${hipblas_samples_common})
endif()

Expand All @@ -66,7 +66,7 @@ list (APPEND hipblas-example-executables hipblas-example-sscal hipblas-example-s
if( CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" OR CMAKE_CXX_COMPILER MATCHES ".*/amdclang\\+\\+$")
list (APPEND hipblas-example-executables hipblas-example-hgemm)
endif( )
if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
list (APPEND hipblas-example-executables hipblas-example-bfdot-hip-bfloat16)
target_compile_options(hipblas-example-bfdot-hip-bfloat16 PRIVATE -DHIPBLAS_USE_HIP_BFLOAT16)
endif()
Expand Down Expand Up @@ -99,22 +99,16 @@ foreach( exe IN LISTS hipblas-example-executables)

target_link_libraries( ${exe} PRIVATE roc::hipblas )

if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
target_link_libraries( ${exe} PRIVATE hip::host )

if( CUSTOM_TARGET )
target_link_libraries( ${exe} PRIVATE hip::${CUSTOM_TARGET} )
endif( )

else( )
target_compile_definitions( ${exe} PRIVATE ${HIPBLAS_HIP_PLATFORM_COMPILER_DEFINES} )

target_include_directories( ${exe}
PRIVATE
$<BUILD_INTERFACE:${CUDA_INCLUDE_DIRS}>
)

target_link_libraries( ${exe} PRIVATE ${CUDA_LIBRARIES} )
target_compile_definitions( ${exe} PRIVATE ${HIPBLAS_CUDA_COMPILER_DEFINES} )
target_link_libraries( ${exe} PRIVATE hip::host CUDA::cudart )
endif( )

set_target_properties( ${exe} PROPERTIES
Expand Down
6 changes: 4 additions & 2 deletions projects/hipblas/docs/install/Linux_Install_Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ A few commands in the script require ``sudo`` access, which might prompt you for

You can run the ``rmake.py`` script from the ``projects/hipblas`` directory.

The install script determines the build platform by querying ``hipconfig --platform``. This value can be explicitly defined
by setting the environment variable ``HIP_PLATFORM`` to ``HIP_PLATFORM=amd`` or ``HIP_PLATFORM=nvidia``.
To build for the CUDA backend, pass ``--cuda`` to ``rmake.py`` or ``install.sh``.
This sets ``-DUSE_CUDA=ON`` in CMake and invokes ``nvcc`` directly without
relying on ``hipcc``. ``nvcc`` must be on ``PATH`` or the CUDA install location
specified via ``--cudapath``.

Common examples showing how to use ``rmake.py`` to build the library dependencies and library are listed
in this table.
Expand Down
15 changes: 5 additions & 10 deletions projects/hipblas/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ install_packages( )
local library_dependencies_fedora=( "make" "gcc-c++" "libcxx-devel" "rpm-build" )
local library_dependencies_sles=( "make" "gcc-c++" "rpm-build" )

if [[ $HIP_PLATFORM == "nvidia" ]]; then
if [[ "${build_cuda}" == true ]]; then
# Ideally, this could be cuda-cublas-dev, but the package name has a version number in it
library_dependencies_ubuntu+=( "" ) # removed, use --installcuda option to install cuda
else
Expand Down Expand Up @@ -360,9 +360,10 @@ cat <<EOF

--cmake_install Install minimum cmake version if required.

--cuda, --use-cuda Build library for CUDA backend (deprecated).
The target HIP platform is determined by \`hipconfig --platform\`.
To explicitly specify a platform, set the \`HIP_PLATFORM\` environment variable.
--cuda, --use-cuda Build library for CUDA backend using nvcc
directly (no hipcc dependency). Passes
-DUSE_CUDA=ON to CMake. nvcc must be on
PATH or reachable via --cudapath.

-d, --dependencies Build and install external dependencies. Dependencies are to be installed in /usr/local.
This should be done only once (this does not install rocBLAS, rocSolver, or cuda).
Expand Down Expand Up @@ -458,8 +459,6 @@ while true; do
shift ;;
--cuda|--use-cuda)
# still need this flag in install.sh to support install.sh --cuda -d for now
echo "--cuda option is deprecated (use environment variable HIP_PLATFORM=nvidia)"
export HIP_PLATFORM="nvidia"
build_cuda=true
shift ;;
--installcuda)
Expand Down Expand Up @@ -572,10 +571,6 @@ else
full_build_dir=${build_dir}/debug
fi

# this can be removed and be done in rmake.py once --cuda flag support is gone
if [[ "${build_cuda}" != true ]]; then
export HIP_PLATFORM="$(${rocm_path}/bin/hipconfig --platform)"
fi

if [[ "${rmake_invoked}" == false ]]; then
pushd .
Expand Down
22 changes: 9 additions & 13 deletions projects/hipblas/library/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ endfunction( )
# ########################################################################
prepend_path( ".." hipblas_headers_public relative_hipblas_headers_public )

if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
set( hipblas_source "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/hipblas.cpp" )

message(STATUS "** NOTE: amd_detail/hipblas.cpp is compiled with the verbose flag -v for QC purposes.")
Expand Down Expand Up @@ -66,10 +66,10 @@ endif()
set(static_depends)

find_package( hipblas-common REQUIRED CONFIG PATHS ${ROCM_PATH})
target_link_libraries( hipblas PUBLIC roc::hipblas-common )
target_link_libraries( hipblas PUBLIC roc::hipblas-common hip::host )

# Build hipblas from source on AMD platform
if(HIP_PLATFORM STREQUAL amd)
if(NOT USE_CUDA)
if( NOT TARGET rocblas )
if( CUSTOM_ROCBLAS )
set ( ENV{rocblas_DIR} ${CUSTOM_ROCBLAS})
Expand All @@ -83,7 +83,6 @@ if(HIP_PLATFORM STREQUAL amd)

list(APPEND static_depends PACKAGE rocblas)
target_link_libraries( hipblas PRIVATE roc::rocblas )
target_link_libraries( hipblas PUBLIC hip::host )

# Add rocSOLVER as a dependency if BUILD_WITH_SOLVER is on
if( BUILD_WITH_SOLVER )
Expand Down Expand Up @@ -112,15 +111,11 @@ if(HIP_PLATFORM STREQUAL amd)
endif( )

else( )
target_compile_definitions( hipblas PRIVATE ${HIPBLAS_HIP_PLATFORM_COMPILER_DEFINES} )
target_compile_definitions( hipblas PRIVATE ${HIPBLAS_CUDA_COMPILER_DEFINES} )

target_link_libraries( hipblas PRIVATE ${CUDA_CUBLAS_LIBRARIES} )

# External header includes included as system files
target_include_directories( hipblas
SYSTEM PRIVATE
$<BUILD_INTERFACE:${CUDA_INCLUDE_DIRS}>
)
# hipBLAS' public headers expose HIP and cuBLAS declarations on this backend,
# so propagate their usage requirements to clients of roc::hipblas.
target_link_libraries( hipblas PUBLIC CUDA::cublas CUDA::cudart )
endif( )

# External header includes included as system files
Expand Down Expand Up @@ -179,7 +174,7 @@ rocm_install_targets(
)
# PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ

if(HIP_PLATFORM STREQUAL amd )
if(NOT USE_CUDA )
rocm_export_targets(
TARGETS roc::hipblas
DEPENDS PACKAGE hip
Expand All @@ -191,6 +186,7 @@ else( )
rocm_export_targets(
TARGETS roc::hipblas
DEPENDS PACKAGE HIP
DEPENDS PACKAGE CUDAToolkit
DEPENDS PACKAGE hipblas-common
NAMESPACE roc::
)
Expand Down
41 changes: 20 additions & 21 deletions projects/hipblas/rmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def parse_args():
help='Specify path to host compiler. Default is amdclang++.')

parser.add_argument('--cuda', '--use-cuda', dest='use_cuda', required=False, default=False, action='store_true',
help='[DEPRECATED] Build library for CUDA backend. Deprecated, use HIP_PLATFORM environment variable to override default which is determined by `hipconfig --platform`')
help='Build library for CUDA backend using nvcc directly (sets -DUSE_CUDA=ON). '
'nvcc must be on PATH or specified via --cudapath.')

parser.add_argument( '--cudapath', type=str, required=False, default='/usr/local/cuda', dest='cuda_path',
help='Specify path of CUDA install.')
Expand Down Expand Up @@ -280,9 +281,11 @@ def config_cmd():
if args.compiler is not None:
cmake_options.append(f"-DCMAKE_CXX_COMPILER={args.compiler}")

# amdclang++ default in linux toolchain, clang++ in windows toolchain
# amdclang++ default in linux toolchain, clang++ in windows toolchain.
# Skip when targeting CUDA: nvcc drives device compilation and g++ is not
# the right host compiler for CUDA workflows.
if os.name != "nt" and args.compiler is None:
if not args.use_amdclang_compiler:
if not args.use_amdclang_compiler and not args.use_cuda:
cmake_options.append(f"-DCMAKE_CXX_COMPILER=g++")

if args.static_lib:
Expand Down Expand Up @@ -337,8 +340,19 @@ def config_cmd():
rocsolver_path_cmake = f'"{raw_rocsolver_path}"'
cmake_options.append( f"-DCUSTOM_ROCSOLVER={rocsolver_path_cmake}")

if args.cuda_path:
os.environ['CUDA_BIN_PATH'] = args.cuda_path
# CUDA backend: pass USE_CUDA=ON and locate nvcc so CMake's find_package(CUDAToolkit)
# resolves without any hipcc involvement.
if args.use_cuda:
cmake_options.append("-DUSE_CUDA=ON")
cuda_path = args.cuda_path # defaults to /usr/local/cuda
nvcc_candidate = os.path.join(cuda_path, 'bin', 'nvcc')
if not os.path.exists(nvcc_candidate):
nvcc_candidate = which('nvcc') or ''
if not nvcc_candidate:
fatal("nvcc not found. Install the CUDA toolkit or pass "
"--cudapath=/path/to/cuda to specify its location.")
cmake_options.append(f"-DCUDA_TOOLKIT_ROOT_DIR={cuda_path}")
cmake_options.append(f"-DCMAKE_CUDA_COMPILER={nvcc_candidate}")

if args.cmake_dargs:
for i in args.cmake_dargs:
Expand Down Expand Up @@ -385,22 +399,7 @@ def main():
os_detect()
args = parse_args()

rocm_path = get_rocm_path()

# support --cuda flag for now by overwriting HIP_PLATFORM envvar
if args.use_cuda:
os.environ['HIP_PLATFORM'] = 'nvidia'
print("--cuda option is deprecated (use environment variable HIP_PLATFORM=nvidia)")

# otherwise query hipconfig to get platform
if which('hipconfig') is not None:
os.environ['HIP_PLATFORM'] = subprocess.getoutput('hipconfig --platform')
elif which(f'{rocm_path}/bin/hipconfig') is not None:
os.environ['HIP_PLATFORM'] = subprocess.getoutput(f'{rocm_path}/bin/hipconfig --platform')
else:
os.environ['HIP_PLATFORM'] = 'amd' # if can't find hipconfig, default amd

if os.environ['HIP_PLATFORM'] == 'nvidia' and args.static_lib:
if args.use_cuda and args.static_lib:
fatal("Static library not supported for CUDA backend. Not continuing.")

if args.install_invoked:
Expand Down
1 change: 1 addition & 0 deletions projects/hipblaslt/cmake/hipblaslt_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function(hipblaslt_configure_bundled_python_command python_binary_dir asan_optio
"${CMAKE_COMMAND}" -E env
"PYTHONPATH=${_python_path}"
"PATH=${_path}"
"ROCM_VERSION=${hip_VERSION}"
"${asan_options}"
--
"${Python3_EXECUTABLE}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1027,12 +1027,11 @@ def run():
arguments = parseArguments()
setVerbosity(arguments["PrintLevel"])
outputPath = Path(ensurePath(os.path.abspath(arguments["OutputPath"])))
cxxCompiler, _, offloadBundler, _, _ = validateToolchain(
cxxCompiler, _, offloadBundler, _ = validateToolchain(
arguments["CxxCompiler"],
arguments["CCompiler"],
arguments["OffloadBundler"],
arguments["Assembler"],
ToolchainDefaults.HIP_CONFIG,
)

if ";" in arguments["Architecture"]:
Expand Down
Loading
Loading