Skip to content

Commit 619cf5e

Browse files
authored
Merge pull request #108 from kknox/disable-cuda-build
Updating automation
2 parents 9b014ec + d0552b6 commit 619cf5e

9 files changed

+95
-134
lines changed

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,18 @@ option( BUILD_VERBOSE "Output additional build information" OFF )
114114
option( BUILD_SHARED_LIBS "Build rocFFT as a shared library" ON )
115115

116116
# Find HCC/HIP dependencies
117-
if( CMAKE_CXX_COMPILER MATCHES ".*/hcc$" )
117+
if( CMAKE_CXX_COMPILER MATCHES ".*/hcc$|.*/hipcc$" )
118+
message( STATUS "Building with ROCm tools" )
118119
find_package( hcc REQUIRED CONFIG PATHS /opt/rocm )
119-
find_package( hip REQUIRED CONFIG PATHS /opt/rocm )
120120
endif( )
121121

122+
# Hip headers required of all clients; clients use hip to allocate device memory
123+
find_package( hip REQUIRED CONFIG PATHS /opt/rocm )
124+
125+
# Quietly look for CUDA, but if not found it's not an error
126+
# The presense of hip is not sufficient to determine if we want a rocm or cuda backend
127+
find_package( CUDA QUIET )
128+
122129
# CMake list of machine targets
123130
set( AMDGPU_TARGETS gfx803;gfx900 CACHE STRING "List of specific machine types for library to target" )
124131

Jenkinsfile

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,12 @@ Boolean docker_build_inside_image( def build_image, compiler_data compiler_args,
204204
set -x
205205
rm -rf ${docker_context} && mkdir -p ${docker_context}
206206
mv ${paths.project_build_prefix}/build/release/*.deb ${docker_context}
207-
mv ${paths.project_build_prefix}/build/release/*.rpm ${docker_context}
207+
# mv ${paths.project_build_prefix}/build/release/*.rpm ${docker_context}
208208
dpkg -c ${docker_context}/*.deb
209209
"""
210210

211211
archiveArtifacts artifacts: "${docker_context}/*.deb", fingerprint: true
212-
archiveArtifacts artifacts: "${docker_context}/*.rpm", fingerprint: true
212+
// archiveArtifacts artifacts: "${docker_context}/*.rpm", fingerprint: true
213213
}
214214
}
215215
}
@@ -348,13 +348,13 @@ def build_pipeline( compiler_data compiler_args, docker_data docker_args, projec
348348
// The following launches 3 builds in parallel: hcc-ctu, hcc-1.6 and cuda
349349
parallel hcc_ctu:
350350
{
351-
node( 'docker && rocm' )
351+
node( 'docker && rocm && dkms' )
352352
{
353353
def docker_args = new docker_data(
354354
from_image:'compute-artifactory:5001/rocm-developer-tools/hip/master/hip-hcc-ctu-ubuntu-16.04:latest',
355-
build_docker_file:'dockerfile-build-hip-hcc-ctu-ubuntu-16.04',
356-
install_docker_file:'dockerfile-install-hip-hcc-ctu-ubuntu-16.04',
357-
docker_run_args:'--device=/dev/kfd',
355+
build_docker_file:'dockerfile-build-ubuntu-16.04',
356+
install_docker_file:'dockerfile-rocfft-ubuntu-16.04',
357+
docker_run_args:'--device=/dev/kfd --device=/dev/dri --group-add=video',
358358
docker_build_args:' --pull' )
359359

360360
def compiler_args = new compiler_data(
@@ -381,13 +381,13 @@ parallel hcc_ctu:
381381
},
382382
hcc_rocm:
383383
{
384-
node( 'docker && rocm' )
384+
node( 'docker && rocm && !dkms' )
385385
{
386386
def hcc_docker_args = new docker_data(
387-
from_image:'rocm/rocm-terminal:latest',
388-
build_docker_file:'dockerfile-build-rocm-terminal',
389-
install_docker_file:'dockerfile-install-rocm-terminal',
390-
docker_run_args:'--device=/dev/kfd',
387+
from_image:'rocm/dev-ubuntu-16.04:latest',
388+
build_docker_file:'dockerfile-build-ubuntu-16.04',
389+
install_docker_file:'dockerfile-rocfft-ubuntu-16.04',
390+
docker_run_args:'--device=/dev/kfd --device=/dev/dri --group-add=video',
391391
docker_build_args:' --pull' )
392392

393393
def hcc_compiler_args = new compiler_data(
@@ -411,38 +411,37 @@ hcc_rocm:
411411

412412
build_pipeline( hcc_compiler_args, hcc_docker_args, rocfft_paths, print_version_closure )
413413
}
414-
},
415-
nvcc:
416-
{
417-
node( 'docker && cuda' )
418-
{
419-
def hcc_docker_args = new docker_data(
420-
from_image:'nvidia/cuda:9.0-devel',
421-
build_docker_file:'dockerfile-build-nvidia-cuda',
422-
install_docker_file:'dockerfile-install-nvidia-cuda',
423-
docker_run_args:'--device=/dev/nvidiactl --device=/dev/nvidia0 --device=/dev/nvidia-uvm --device=/dev/nvidia-uvm-tools --volume-driver=nvidia-docker --volume=nvidia_driver_384.90:/usr/local/nvidia:ro',
424-
docker_build_args:' --pull' )
425-
426-
def hcc_compiler_args = new compiler_data(
427-
compiler_name:'nvcc-9.0',
428-
build_config:'Release',
429-
compiler_path:'g++' )
430-
431-
def rocfft_paths = new project_paths(
432-
project_name:'rocfft-nvcc',
433-
src_prefix:'src',
434-
build_prefix:'src',
435-
build_command: './install.sh -cd --cuda' )
436-
437-
def print_version_closure = {
438-
sh """
439-
set -x
440-
nvidia-smi
441-
nvcc --version
442-
"""
443-
}
444-
445-
build_pipeline( hcc_compiler_args, hcc_docker_args, rocfft_paths, print_version_closure )
446-
}
447-
}
448-
414+
} //,
415+
// nvcc:
416+
// {
417+
// node( 'docker && cuda' )
418+
// {
419+
// def hcc_docker_args = new docker_data(
420+
// from_image:'nvidia/cuda:9.1-devel-ubuntu16.04',
421+
// build_docker_file:'dockerfile-build-nvidia-cuda',
422+
// install_docker_file:'dockerfile-rocfft-ubuntu-cuda',
423+
// docker_run_args:'--runtime=nvidia',
424+
// docker_build_args:' --pull' )
425+
426+
// def hcc_compiler_args = new compiler_data(
427+
// compiler_name:'nvcc-9.1',
428+
// build_config:'Release',
429+
// compiler_path:'g++' )
430+
431+
// def rocfft_paths = new project_paths(
432+
// project_name:'rocfft-nvcc',
433+
// src_prefix:'src',
434+
// build_prefix:'src',
435+
// build_command: './install.sh -cd --cuda' )
436+
437+
// def print_version_closure = {
438+
// sh """
439+
// set -x
440+
// nvidia-smi
441+
// nvcc --version
442+
// """
443+
// }
444+
445+
// build_pipeline( hcc_compiler_args, hcc_docker_args, rocfft_paths, print_version_closure )
446+
// }
447+
// }

docker/dockerfile-build-hip-hcc-ctu-ubuntu-16.04

Lines changed: 0 additions & 37 deletions
This file was deleted.

docker/dockerfile-build-nvidia-cuda

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
2626
pkg-config \
2727
libfftw3-dev \
2828
libboost-program-options-dev \
29-
hip_hcc \
30-
hip_nvcc \
31-
cuda \
3229
&& \
3330
apt-get clean && \
3431
rm -rf /var/lib/apt/lists/*

docker/dockerfile-build-rocm-terminal renamed to docker/dockerfile-build-ubuntu-16.04

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
# This Dockerfile provides a starting point for a ROCm installation of hipCaffe.
2-
3-
# Parameters related to building hip
1+
# Parameters related to building rocfft
42
ARG base_image
53

64
FROM ${base_image}
7-
LABEL maintainer="kent.knox@amd"
5+
MAINTAINER Kent Knox <kent.knox@amd>
86

9-
USER root
107
ARG user_uid
118

12-
# Install dependent packages
9+
# Install Packages & dependent packages
1310
# Dependencies:
1411
# * hcc-config.cmake: pkg-config
15-
# * tensile: python2.7, python-yaml
16-
# * rocblas-test: gfortran, googletest
17-
# * rocblas-bench: libboost-program-options-dev
12+
# * rocblas-test: libfftw3-dev, googletest
13+
# * rocfft-bench: libboost-program-options-dev
14+
# * rocm_agent_enumerator: python, libnuma1
1815
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
16+
sudo \
17+
build-essential \
1918
cmake \
2019
ca-certificates \
2120
git \
2221
pkg-config \
2322
libfftw3-dev \
2423
libboost-program-options-dev \
25-
rpm \
24+
python \
25+
libnuma1 \
2626
&& \
2727
apt-get clean && \
2828
rm -rf /var/lib/apt/lists/*

docker/dockerfile-install-rocm-terminal

Lines changed: 0 additions & 15 deletions
This file was deleted.

docker/dockerfile-install-hip-hcc-ctu-ubuntu-16.04 renamed to docker/dockerfile-rocfft-ubuntu-16.04

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Parameters related to building rocblas
1+
# Parameters related to building rocfft
22
ARG base_image
33

44
FROM ${base_image}
55
LABEL maintainer="kent.knox@amd"
66

7-
# Copy the debian package of rocblas into the container from host
7+
# Copy the debian package of rocfft into the container from host
88
COPY *.deb /tmp/
99

1010
# Install the debian package

install.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,14 @@ if [[ "${install_dependencies}" == true ]]; then
158158
fi
159159
done
160160

161-
# The following builds googletest from source, installs into cmake default /usr/local
161+
# The following builds googletest from source
162162
pushd .
163-
printf "\033[32mBuilding \033[33mgoogletest\033[32m from source; installing into \033[33m/usr/local\033[0m\n"
163+
printf "\033[32mBuilding \033[33mgoogletest\033[32m from source"
164164
mkdir -p ${build_dir}/deps && cd ${build_dir}/deps
165-
cmake -DBUILD_BOOST=OFF ../../deps
165+
cmake -DBUILD_BOOST=OFF -DCMAKE_INSTALL_PREFIX=deps-install ../../deps
166166
make -j$(nproc)
167-
elevate_if_not_root make install
167+
# elevate_if_not_root make install
168+
make install
168169
popd
169170
fi
170171

@@ -195,7 +196,7 @@ pushd .
195196

196197
# On ROCm platforms, hcc compiler can build everything
197198
if [[ "${build_cuda}" == false ]]; then
198-
CXX=hcc cmake ${cmake_common_options} ${cmake_client_options} ../..
199+
CXX=hcc cmake ${cmake_common_options} ${cmake_client_options} -DCMAKE_PREFIX_PATH="$(pwd)/../deps/deps-install" ../..
199200
make -j$(nproc)
200201
else
201202
# The nvidia compile is a little more complicated, in that we split compiling the library from the clients
@@ -213,7 +214,7 @@ pushd .
213214
# Build cuda clients with default host compiler
214215
if [[ "${build_clients}" == true ]]; then
215216
pushd clients
216-
cmake ${cmake_common_options} ${cmake_client_options} -DCMAKE_PREFIX_PATH=$(pwd)/../rocfft-install ../../../clients
217+
cmake ${cmake_common_options} ${cmake_client_options} -DCMAKE_PREFIX_PATH="$(pwd)/../rocfft-install;$(pwd)/../deps/deps-install" ../../../clients
217218
make -j$(nproc)
218219
popd
219220
fi

library/CMakeLists.txt

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,30 +106,39 @@ set( INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR} )
106106
add_subdirectory( src )
107107

108108
# The following code is setting variables to control the behavior of CPack to generate our
109-
if( WIN32 )
110-
set( CPACK_SOURCE_GENERATOR "ZIP" )
111-
set( CPACK_GENERATOR "ZIP" )
112-
else( )
113-
set( CPACK_SOURCE_GENERATOR "TGZ" )
114-
set( CPACK_GENERATOR "DEB;RPM" CACHE STRING "cpack list: 7Z, DEB, IFW, NSIS, NSIS64, RPM, STGZ, TBZ2, TGZ, TXZ, TZ, ZIP" )
115-
# set( CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON )
116-
endif( )
109+
# if( WIN32 )
110+
# set( CPACK_SOURCE_GENERATOR "ZIP" )
111+
# set( CPACK_GENERATOR "ZIP" )
112+
# else( )
113+
# set( CPACK_SOURCE_GENERATOR "TGZ" )
114+
# set( CPACK_GENERATOR "DEB;RPM" CACHE STRING "cpack list: 7Z, DEB, IFW, NSIS, NSIS64, RPM, STGZ, TBZ2, TGZ, TXZ, TZ, ZIP" )
115+
# # set( CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON )
116+
# endif( )
117117

118118
# Package specific CPACK vars
119-
set( CPACK_DEBIAN_PACKAGE_DEPENDS "hip_hcc (>= 1.0.17174)" )
120-
set( CPACK_RPM_PACKAGE_REQUIRES "hip_hcc >= 1.0.17174" )
119+
set( CPACK_DEBIAN_PACKAGE_DEPENDS "hip_hcc (>= 1.3)" )
120+
set( CPACK_RPM_PACKAGE_REQUIRES "hip_hcc >= 1.3" )
121121
set( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.md" )
122122

123+
if( NOT CPACK_PACKAGING_INSTALL_PREFIX )
124+
set( CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" )
125+
endif( )
126+
127+
set( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "\${CPACK_PACKAGING_INSTALL_PREFIX}" "\${CPACK_PACKAGING_INSTALL_PREFIX}/include" )
128+
123129
# Give rocfft compiled for CUDA backend a different name
124-
if( CMAKE_CXX_COMPILER MATCHES ".*/hcc$" )
125-
set( package_name rocfft )
130+
if( NOT CUDA_FOUND )
131+
set( package_name rocfft )
126132
else( )
127-
set( package_name rocfft-alt )
133+
set( package_name rocfft-alt )
128134
endif( )
129135

136+
set( ROCFFT_CONFIG_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Path placed into ldconfig file" )
137+
130138
rocm_create_package(
131139
NAME ${package_name}
132140
DESCRIPTION "Radeon Open Compute FFT library"
133141
MAINTAINER "Kent Knox <[email protected]>"
134142
LDCONFIG
143+
LDCONFIG_DIR ${ROCFFT_CONFIG_DIR}
135144
)

0 commit comments

Comments
 (0)