Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: CUDA #2872

Merged
merged 12 commits into from
Jan 5, 2025
Merged
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
6 changes: 6 additions & 0 deletions anda/lib/nvidia/compat-nvidia-repo/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project pkg {
arches = ["x86_64"]
rpm {
spec = "compat-nvidia-repo.spec"
}
}
34 changes: 34 additions & 0 deletions anda/lib/nvidia/compat-nvidia-repo/compat-nvidia-repo.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Name: compat-nvidia-repo
Version: 565.77
Epoch: 3
Release: 1%{?dist}
Summary: Compatibility package required by official CUDA packages
License: NVIDIA License
URL: https://developer.nvidia.com/cuda-toolkit

BuildArch: noarch

Requires: nvidia-driver >= %{?epoch:%{epoch}:}%{version}
Requires: nvidia-driver-cuda >= %{?epoch:%{epoch}:}%{version}
Requires: nvidia-driver-cuda-libs >= %{?epoch:%{epoch}:}%{version}
Requires: nvidia-driver-libs >= %{?epoch:%{epoch}:}%{version}
Requires: nvidia-kmod >= %{?epoch:%{epoch}:}%{version}
Requires: nvidia-settings >= %{?epoch:%{epoch}:}%{version}

Provides: cuda-drivers >= %{?epoch:%{epoch}:}%{version}
Provides: nvidia-open >= %{?epoch:%{epoch}:}%{version}
# Add any versioned provides:
Provides: cuda-drivers-560 >= %{?epoch:%{epoch}:}%{version}
Provides: cuda-drivers-565 >= %{?epoch:%{epoch}:}%{version}
Provides: nvidia-open-560 >= %{?epoch:%{epoch}:}%{version}
Provides: nvidia-open-565 >= %{?epoch:%{epoch}:}%{version}

%description
Nvidia drivers metapackage required by official CUDA packages. It pulls in all
Nvidia driver components.

%files
# Without an empty files section the package is not created.

%changelog
%autochangelog
5 changes: 5 additions & 0 deletions anda/lib/nvidia/cuda-cccl/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "cuda-cccl.spec"
}
}
58 changes: 58 additions & 0 deletions anda/lib/nvidia/cuda-cccl/cuda-cccl.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
%global real_name cuda_cccl

%global debug_package %{nil}
%global major_package_version 12-6

Name: %(echo %real_name | tr '_' '-')
Epoch: 1
Version: 12.6.77
Release: 1%{?dist}
Summary: CXX Core Compute Libraries
License: CUDA Toolkit
URL: https://developer.nvidia.com/cuda-toolkit
ExclusiveArch: x86_64 aarch64

Source0: https://developer.download.nvidia.com/compute/cuda/redist/%{real_name}/linux-x86_64/%{real_name}-linux-x86_64-%{version}-archive.tar.xz
Source1: https://developer.download.nvidia.com/compute/cuda/redist/%{real_name}/linux-sbsa/%{real_name}-linux-sbsa-%{version}-archive.tar.xz

Requires: cmake-filesystem
Conflicts: %{name}-%{major_package_version} < %{?epoch:%{epoch}:}%{version}

%description
CXX Core Compute Libraries.

%package devel
Summary: CXX Core Compute Libraries development files

%description devel
CXX Core Compute Libraries development files.

%prep
%ifarch x86_64
%setup -q -n %{real_name}-linux-x86_64-%{version}-archive
%endif

%ifarch aarch64
%setup -q -T -b 1 -n %{real_name}-linux-sbsa-%{version}-archive
%endif

%install
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}/cmake

cp -fr include/* %{buildroot}%{_includedir}/
# Conflict with rocthrust-devel in main repositories:
mv %{buildroot}%{_includedir}/thrust %{buildroot}%{_includedir}/cuda/

cp -fr lib/cmake/* %{buildroot}%{_libdir}/cmake
rm -f %{buildroot}%{_libdir}/cmake/thrust/README.md

%files devel
%license LICENSE
%doc lib/cmake/thrust/README.md
%{_includedir}/*
%{_libdir}/cmake/*

%changelog
%autochangelog

5 changes: 5 additions & 0 deletions anda/lib/nvidia/cuda-cudart/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "cuda-cudart.spec"
}
}
87 changes: 87 additions & 0 deletions anda/lib/nvidia/cuda-cudart/cuda-cudart.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
%global real_name cuda_cudart

%global debug_package %{nil}
%global __strip /bin/true
%global _missing_build_ids_terminate_build 0
%global _build_id_links none
%global major_package_version 12-6

Name: %(echo %real_name | tr '_' '-')
Epoch: 1
Version: 12.6.77
Release: 1%{?dist}
Summary: CUDA Runtime API library
License: CUDA Toolkit
URL: https://developer.nvidia.com/cuda-toolkit
ExclusiveArch: x86_64 aarch64

Source0: https://developer.download.nvidia.com/compute/cuda/redist/%{real_name}/linux-x86_64/%{real_name}-linux-x86_64-%{version}-archive.tar.xz
Source1: https://developer.download.nvidia.com/compute/cuda/redist/%{real_name}/linux-sbsa/%{real_name}-linux-sbsa-%{version}-archive.tar.xz
Source3: cudart.pc

Requires(post): ldconfig
Conflicts: %{name}-%{major_package_version} < %{?epoch:%{epoch}:}%{version}-%{release}

%description
CUDA Runtime (cudart).

%package devel
Summary: Development files for NVIDIA CUDA Runtime API library
Requires: opencl-headers
Requires: %{name}%{_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Conflicts: %{name}-devel-%{major_package_version} < %{?epoch:%{epoch}:}%{version}

%description devel
This package provides development files for the NVIDIA CUDA Runtime API library.

%package static
Summary: Static libraries for NVIDIA CUDA Runtime API
Requires: %{name}-devel%{_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description static
This package contains static libraries for NVIDIA CUDA Runtime API.

%prep
%ifarch x86_64
%setup -q -n %{real_name}-linux-x86_64-%{version}-archive
%endif

%ifarch aarch64
%setup -q -T -b 1 -n %{real_name}-linux-sbsa-%{version}-archive
%endif

%install
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_libdir}/pkgconfig/

cp -fr include/* %{buildroot}%{_includedir}/
rm -fr %{buildroot}%{_includedir}/CL
cp -fr lib/libcu* %{buildroot}%{_libdir}/
cp -fr %{SOURCE3} %{buildroot}/%{_libdir}/pkgconfig/

# Set proper variables
sed -i \
-e 's|CUDA_VERSION|%{version}|g' \
-e 's|LIBDIR|%{_libdir}|g' \
-e 's|INCLUDE_DIR|%{_includedir}|g' \
%{buildroot}/%{_libdir}/pkgconfig/*.pc

%{?ldconfig_scriptlets}

%files
%license LICENSE
%{_libdir}/libcudart.so.*

%files devel
%{_includedir}/*
%{_libdir}/libcudadevrt.a
%{_libdir}/libcudart.so
%{_libdir}/libculibos.a
%{_libdir}/pkgconfig/cudart.pc

%files static
%{_libdir}/libcudart_static.a

%changelog
%autochangelog
8 changes: 8 additions & 0 deletions anda/lib/nvidia/cuda-cudart/cudart.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
libdir=LIBDIR
includedir=INCLUDE_DIR

Name: cudart
Description: CUDA Runtime Library
Version: CUDA_VERSION
Libs: -L${libdir} -lcudart
Cflags: -I${includedir}
5 changes: 5 additions & 0 deletions anda/lib/nvidia/cuda-cudnn/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "cuda-cudnn.spec"
}
}
76 changes: 76 additions & 0 deletions anda/lib/nvidia/cuda-cudnn/cuda-cudnn.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
%global debug_package %{nil}
%global __strip /bin/true
%global _missing_build_ids_terminate_build 0
%global _build_id_links none
%global cuda_version 12

Name: cuda-cudnn
Version: 9.6.0.74
Release: 1%{?dist}
Epoch: 1
Summary: NVIDIA CUDA Deep Neural Network library (cuDNN)
License: NVIDIA Software Development Kit
URL: https://developer.nvidia.com/cudnn
ExclusiveArch: x86_64 aarch64

Source0: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-%{version}_cuda%{cuda_version}-archive.tar.xz
Source1: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-sbsa/cudnn-linux-sbsa-%{version}_cuda%{cuda_version}-archive.tar.xz

%description
The NVIDIA CUDA Deep Neural Network library (cuDNN) is a GPU-accelerated
library of primitives for deep neural networks. cuDNN provides highly tuned
implementations for standard routines such as forward and backward convolution,
pooling, normalization, and activation layers. cuDNN is part of the NVIDIA Deep
Learning SDK.

%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: cuda%{?_isa} >= %{?epoch:%{epoch}:}%{cuda_version}

%description devel
The %{name}-devel package contains libraries and header files for developing
applications that use %{name}.

%package static
Summary: Static libraries for %{name}
Requires: %{name}-devel%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description static
Static library files for %{name}.

%prep
%ifarch x86_64
%setup -q -n cudnn-linux-x86_64-%{version}_cuda%{cuda_version}-archive
%endif

%ifarch aarch64
%setup -q -T -b 1 -n cudnn-linux-sbsa-%{version}_cuda%{cuda_version}-archive
%endif

%install
mkdir -p %{buildroot}%{_libdir}
cp -a lib/*.so* %{buildroot}%{_libdir}/
chmod 755 %{buildroot}%{_libdir}/*.so*
cp -a lib/*.a %{buildroot}%{_libdir}/
chmod 644 %{buildroot}%{_libdir}/*.a

mkdir -p %{buildroot}%{_includedir}
cp -a include/* %{buildroot}%{_includedir}/
chmod 644 %{buildroot}%{_includedir}/*

%{?ldconfig_scriptlets}

%files
%license LICENSE
%{_libdir}/libcudnn*.so.*

%files devel
%{_includedir}/cudnn*
%{_libdir}/libcudnn*.so

%files static
%{_libdir}/libcudnn*.a

%changelog
%autochangelog
5 changes: 5 additions & 0 deletions anda/lib/nvidia/cuda-cuobjdump/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "cuda-cuobjdump.spec"
}
}
48 changes: 48 additions & 0 deletions anda/lib/nvidia/cuda-cuobjdump/cuda-cuobjdump.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
%global real_name cuda_cuobjdump

%global debug_package %{nil}
%global __strip /bin/true
%global _missing_build_ids_terminate_build 0
%global _build_id_links none
%global major_package_version 12-6

Name: %(echo %real_name | tr '_' '-')
Epoch: 1
Version: 12.6.77
Release: 1%{?dist}
Summary: Utility to extract information from CUDA binary files
License: CUDA Toolkit
URL: https://developer.nvidia.com/cuda-toolkit
ExclusiveArch: x86_64 aarch64

Source0: https://developer.download.nvidia.com/compute/cuda/redist/%{real_name}/linux-x86_64/%{real_name}-linux-x86_64-%{version}-archive.tar.xz
Source1: https://developer.download.nvidia.com/compute/cuda/redist/%{real_name}/linux-sbsa/%{real_name}-linux-sbsa-%{version}-archive.tar.xz

Conflicts: %{name}-%{major_package_version} < %{?epoch:%{epoch}:}%{version}-%{release}

%description
cuobjdump extracts information from CUDA binary files (both standalone and those
embedded in host binaries) and presents them in human readable format. The
output of cuobjdump includes CUDA assembly code for each kernel, CUDA ELF
section headers, string tables, relocators and other CUDA specific sections. It
also extracts embedded ptx text from host binaries.

%prep
%ifarch x86_64
%setup -q -n %{real_name}-linux-x86_64-%{version}-archive
%endif

%ifarch aarch64
%setup -q -T -b 1 -n %{real_name}-linux-sbsa-%{version}-archive
%endif

%install
install -m 0755 -p -D bin/cuobjdump %{buildroot}%{_bindir}/cuobjdump

%files
%license LICENSE
%{_bindir}/cuobjdump

%changelog
%autochangelog

5 changes: 5 additions & 0 deletions anda/lib/nvidia/cuda-cupti/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "cuda-cupti.spec"
}
}
Loading
Loading