1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 # Maintainer: Konstantin Gizdov <arch@kge.pw>
3 pkgname=(cuda cuda-tools)
8 pkgdesc="NVIDIA's GPU programming toolkit"
10 url="https://developer.nvidia.com/cuda-zone"
11 license=('custom:NVIDIA')
12 depends=('opencl-nvidia' 'nvidia-utils' 'python' 'gcc12')
13 options=(!strip staticlibs)
15 source=(https://developer.download.nvidia.com/compute/cuda/${pkgver}/local_installers/cuda_${pkgver}_${_driverver}_linux.run
46 sha512sums=('2f5b07b6253a7268afa81345acc8be9fc3ab80f7f5c565d199f72ac74467d562eb83b72f87f33bafa90c88612b16366c3e209cbec1cb0b5907839e5823520323'
47 '35f1f56411eecb2d978553f5606a0d6e70ad363cfaa9f37b9e6f12a799b041caa4aeca183341055d4789425dc4d62bee0aac68cc9d864155084b1ea571ee998f'
48 '714d973bc79446f73bebe85306b3566fe25b554bcbcba2fcbe76709a3eca71fb5d183ab4da2d3b5e9326cb9cd8d13a93f6d4a005ea5a41f7ef8e6c6e81e06b5e'
49 'a4b3b03682801a98a1d8c1d14c084fd35efd384d92d497e230e3a28e0bd97b1fa48a93ccb2150f892f0b4154ca4ea2d66f5484a6a59b5c9b49963de42ecf1736'
50 'd69d3ec0e270648f55d8c3e420f89d056b120eca5b25e9e7fc1cca799d1a252909ee31ff399c137223eca57cdf82b856221a251b6ff1daf5d6f75c1a582b1e32'
51 'e463a596d34cc7d7e42c32e8a72b327aedb8707902dda8767f2c22a6a7e6dda7fcd297c0036b004ce4f1677408084acb6f4ed683cd6c79558ba8bb4e1a83867f'
52 '2fc1a136ecbd7535a46c7c63e1218525230e44d15f461fdb461b727eb12799ebe66d46d57cacda9b7b55bbfed572c1c9a9c5c5f73de6e28da1a1deda7b7eaffd'
53 'd91acc6e7f56f36a4b67ee06f39d87928bc49e7463077f9dc95716151df1a9a6f259ebf01dc860eacf2d5faf2feb4411b6ca8cef50cd5af823875aa5ad54d098'
54 '7bda70d783180d3dafea9f0117e0c396d4aedda3da02fea6c7382139b030c9111e044c454152526cca271d49883240782ba94fe89b098a41d9b451425dc4870d'
55 '408b553d5187e31086e10d236f2c8090045da0fae351c8b170d01aead88ea5f8a0b4ec50e2c5ccbb989167768bec58cb7ae051b7b87c00c59794879844d7679e'
56 '5fb9837e7830a02bd6e1fae0cd959bc35474801ab2836e385678ce893d760ff6b9f47e728707a755f842758cf2fe55c2f7bb04d3941b80a5fd1d4b4ba7a4d428'
57 'd47d8bd10cf1183e9ab3ae59b669e8a8d7cc9127dbb07c4bafbc8b853b285676217e329e1cc49a277d0b9b5623c2e6066b087a66951d2e7fa8007f10aa4c074b'
58 '6728716dbe10553e876cb6a2c556bf9309197eb53c9d31fa1525843383ef531ca7a0913130507064fc24c59057b5f82f45705a23df43d77c5882bf53b087ea4b'
59 '653a29a874fde27defeb06cc4e3c69d9d129d9b9c04f15d2958629eaf03521d361c08fd41abee95378ae72f951f07c15d32e7d5563170829a0c90defebe95a0b'
60 '26c8ad1ff52ae51ee250b71b8427a2b89bd3d64e42c5fe2f55732bffb36e19d2946008e5058cd30d76b8129621aa5440b11601b10afc95f112bb8addfc0aeb0c'
61 'a801a5fb9e963bbd796b050b514b412a6babab26e0cdbd61b7ea55071944723489b4305bebedc8828428756939cebe6bd936bfffed5a6fff8bf39629a8df5cce'
62 'a5fd4fb8fa75d276c154fd48657aeeb689b39bc29cf0efc9c6e0bda741de36d740095007cda9849345c322162513530953ab5598c2dad03ac8c2c0c9395ff79a'
63 '40fbed6b5d62ac90afc0732e6713e34a35c8883b9b30ae76616ff689addb64553fd4b9d09ff360964e01ab2afaa3d3055b2a46725fb937fb117a28c0e5392a1a'
64 'b17ba99efdc2bb8b83b3811ffb43515e663461185c659902bd3111f08f05a196a3919c463102b2d8bd0dea69cba8fa0a6ccc4a86c0b2584459218e1292074a13'
65 '4aa2bab32131bc3a81d5ba8412b10b6b30cebf5a0e1525e56bd7cddf20da8d306ba48165d6a6356eb9c1f705c4b3d58e1bf33c1d07c872c741739e70a7cb20ef'
66 'af4fc1d293978bba254d3db6c941b4b7be2ce9b61d82ddaf1e30e19407f6bf10caa22c4406739179cdb12ebc5396013ea291554edea8d56c1661493804309f87'
67 '367151febaabe4eda8df64a10bbc43e29e5a5236dc4bc064a3a8d12c69818bedbaef156fddf08c99f0eca5bdae20b5a3a0f7e2401efedebf096ea143ef2d09fa'
68 'b0ab2a5dac5fa1c7d2687a0f2f25de271b2638198744a27d492a02651afd4f676ac814252990d476a21f0b0c489d2487b5af766f32839c4d6ab2f91b2bb8ad04'
69 '328b3103a23d5de04efa7adc16d2cb8c23ab6617e0d83072e2ea0269f9af994125ae7e64e372697774fa1bfa9d3ec761d16ea489e51222d8babeca0fde95d239'
70 '4db458ff7db77303423fe38290c98caa1c4bb131d4c863d17880beac6e433998e4f85343b15e7166e3f7d9be41fdacae6ea66516db3b98d6371a16dac266539f'
71 'df4fdc00e02ed8bd15cdda0a7dd375d36ff98c5df6188164caec530ae0d0ad8d632a6f29dbcebe7cad0edf2c579bd3594acb8d09fd81a6a3ba85e2cbc26101cd'
72 '3cb8c30f3936a464dbc214ee820941694e741de767c2636a5ce94cf5ea84d33a6265fff5777fb6a9f7328e076cc4c12e71624b3eb024bc0069d917f506a22750'
73 'c2c0a15c1a1c4fe51c2be1eaf4ff790042b9d42b5959d02522ed7ad18b4c5880dd7d9cdfe88a6d1850b34ce7a22599fadc0e11ca94b595210c9150e44b5e8e66'
74 'ede3cfcaaa655e73e47bd3475d94d33933c6e7c89c7dc7c98d9491e066ab4cf504e12ed4f1eab9edaeb358154bd86a43d359304675efa4fd4a67d01c97986f3b'
75 '4405d88a132f3cf4e6c506962860503537a3c946fbd5f1c29c52bb6e6b45b13d14333bc772c62589337875200b23b0af17c9e5ce188d2f4018f488ea75501054'
76 '16003e7e6307d39a95fe246a7d079e9a3d827bd03fd5f03bdd2051a5033a1f93d9c8531073ef587808a9d0c75d20e3d79417a90b14102bc872d32c2c7a5ebdcb')
79 sh cuda_${pkgver}_${_driverver}_linux.run --target "${srcdir}" --noexec
83 local _prepdir="${srcdir}/prep"
88 mkdir -p "${_prepdir}/opt/cuda/extras"
89 mv integration nsight_compute nsight_systems EULA.txt "${_prepdir}/opt/cuda"
90 mv cuda_demo_suite/extras/demo_suite "${_prepdir}/opt/cuda/extras/demo_suite"
91 mv cuda_sanitizer_api/compute-sanitizer "${_prepdir}/opt/cuda/extras/compute-sanitizer"
92 rmdir cuda_sanitizer_api
94 if [[ "$lib" =~ .*"version.json".* ]]; then
97 cp -r $lib/* "${_prepdir}/opt/cuda/"
100 # Delete some unnecessary files
101 rm -r "${_prepdir}"/opt/cuda/bin/cuda-uninstaller
103 # Define compilers for CUDA to use.
104 # This allows us to use older versions of GCC if we have to.
105 ln -s /usr/bin/gcc-12 "${_prepdir}/opt/cuda/bin/gcc"
106 ln -s /usr/bin/g++-12 "${_prepdir}/opt/cuda/bin/g++"
108 # Install profile and ld.so.config files
109 install -Dm755 "${srcdir}/cuda.sh" "${_prepdir}/etc/profile.d/cuda.sh"
110 install -Dm644 "${srcdir}/cuda.conf" "${_prepdir}/etc/ld.so.conf.d/cuda.conf"
112 # Install pkgconfig files
113 mkdir -p "$_prepdir"/usr/lib/pkgconfig
114 cp "${srcdir}"/*.pc "${_prepdir}"/usr/lib/pkgconfig
116 mkdir -p "${_prepdir}/usr/share/licenses/${pkgname}"
117 ln -s /opt/cuda/EULA.txt "${_prepdir}/usr/share/licenses/${pkgname}/EULA.txt"
118 ln -s /opt/cuda/README "${_prepdir}/usr/share/licenses/${pkgname}/README"
120 # Add a symlink lib->lib64 as some libraries might expect that (FS#76951)
121 ln -s lib64 "${_prepdir}/opt/cuda/lib"
123 # Allow newer compilers to work. This is not officially supported in the Arch package but
124 # if users want to try, let them try.
125 # See https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements
126 # for official requirements
127 sed -i "/.*unsupported GNU version.*/d" "${_prepdir}"/opt/cuda/targets/x86_64-linux/include/crt/host_config.h
128 sed -i "/.*unsupported clang version.*/d" "${_prepdir}"/opt/cuda/targets/x86_64-linux/include/crt/host_config.h
130 # Fix Makefile paths to CUDA
131 for f in $(find "$_prepdir"/opt/cuda -name Makefile); do
132 sed -i "s|/usr/local/cuda|/opt/cuda|g" "$f"
137 replaces=('cuda-toolkit' 'cuda-sdk' 'cuda-static')
138 provides=('cuda-toolkit' 'cuda-sdk' 'libcudart.so' 'libcublas.so' 'libcusolver.so' 'libcusparse.so')
139 optdepends=('gdb: for cuda-gdb'
140 'glu: required for some profiling tools in CUPTI')
142 local _prepdir="${srcdir}/prep"
147 # remove broken links
148 rm "${pkgdir}"/opt/cuda/include/include
149 rm "${pkgdir}"/opt/cuda/lib64/lib64
151 rm -r "${pkgdir}"/opt/cuda/{bin/nvvp,bin/computeprof,libnvvp,nsight*}
154 package_cuda-tools() {
155 pkgdesc="NVIDIA's GPU programming toolkit (extra tools: nvvp, nsight)"
156 depends=('cuda' 'java-runtime=8' 'nss')
157 optdepends=('perl: required by some NVVP plugins')
159 local _prepdir="${srcdir}/prep"
161 mkdir -p "${pkgdir}/opt/cuda/bin"
162 mv "${_prepdir}"/opt/cuda/nsight* "${pkgdir}/opt/cuda"
163 mv "${_prepdir}"/opt/cuda/bin/nvvp "${pkgdir}/opt/cuda/bin/nvvp"
164 mv "${_prepdir}"/opt/cuda/bin/computeprof "${pkgdir}/opt/cuda/bin/computeprof"
165 mv "${_prepdir}"/opt/cuda/libnvvp "${pkgdir}/opt/cuda"
168 mkdir -p "${pkgdir}/usr/share/licenses"
169 ln -s /usr/share/licenses/cuda "${pkgdir}/usr/share/licenses/${pkgname}"
172 # vim:set ts=2 sw=2 et: