Problem upgrading from cuda-10.1u2 to 10.2 on RHEL7

Hi everyone,

I have encountered this problem trying to upgrade from cuda 10.1 update 2 to cuda 10.2 on a RHEL7.6 machine (in reality it is Scientific Linux 7.6):

file /usr/lib/.build-id/29/03e046fa25cd049e093c3a8a9192e91e9b212e from install of nsight-compute-2019.5.0-2019.5.0.14-1.x86_64 conflicts with file from package nsight-compute-2019.4.0-2019.4.0.12-1.x86_64
	file /usr/lib/.build-id/34/aac32bb4d3c0f44e72e57cf253a871240a1154 from install of nsight-compute-2019.5.0-2019.5.0.14-1.x86_64 conflicts with file from package nsight-compute-2019.4.0-2019.4.0.12-1.x86_64
	file /usr/lib/.build-id/80/916a3578c4abf8d9433986b7ca87ee58797eb5 from install of nsight-compute-2019.5.0-2019.5.0.14-1.x86_64 conflicts with file from package nsight-compute-2019.4.0-2019.4.0.12-1.x86_64
	file /usr/lib/.build-id/b7/4e6beb75ab46ddc2c65d78b4d3e6de3b4eb493 from install of nsight-compute-2019.5.0-2019.5.0.14-1.x86_64 conflicts with file from package nsight-compute-2019.4.0-2019.4.0.12-1.x86_64
	file /usr/lib/.build-id/ea/6a2369dae8e186543b5e0fa413cb7ee7058c84 from install of nsight-compute-2019.5.0-2019.5.0.14-1.x86_64 conflicts with file from package nsight-compute-2019.4.0-2019.4.0.12-1.x86_64

This is a packaging error, the files from /usr/lib/.build-id don’t belong into the package at all and this error prevents the parallel installation of nsight-compute-2019.4.0 and nsight-compute-2019.5.0.

This way, cuda 10.2 cannot be installed as an upgrade to 10.1u2, only a fresh installation is possible, cuda 10.1u2 must be completely removed before installing 10.2.

I have worked around this issue by building a repackaged version of the nsight-compute package from this spec file:

%define oname nsight-compute
%define oversion 2019.5.0
%define subversion 14
%define rel 1

Summary: Nsight compute package
Name: %{oname}-%oversion
Version: %oversion.%subversion
Release: 1.dz.1
#% sha256sum nsight-compute-2019.5.0-2019.5.0.14-1.x86_64.rpm
#8120d448b15caf9557782ff376f20d032c571df341daba375551aed021043234  nsight-compute-2019.5.0-2019.5.0.14-1.x86_64.rpm
Source0: %oname-%oversion-%version-%rel.x86_64.rpm
Nosource: 0
License: NVIDIA Proprietary
Group: Unspecified
Url: http://nvidia.com
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Provides: %oname
AutoReq:0


%description
NVIDIA Nsight Compute is an interactive kernel profiler for CUDA
applications on x86_64 platforms. It provides detailed performance
metrics and API debugging via a user interface and command line tool.

%prep
%setup -q -c -T
rpm2cpio  %{SOURCE0} | cpio -imd


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p %buildroot
cp -r * %buildroot
rm -rf %buildroot/usr/lib/.build-id
export QA_RPATHS=2

%clean
rm -rf $RPM_BUILD_ROOT

%postun
if [ $1 -eq 0 ]; then
    update-desktop-database -q 2>/dev/null
fi

%posttrans
gtk-update-icon-cache
update-desktop-database -q 2>/dev/null

%files
%defattr(-,root,root)
%dir /opt/nvidia
/opt/nvidia/%oname
%_datadir/applications/%oname-%oversion.desktop

%changelog
* Thu Jan 16 2020 Götz Waschk <goetz DOT waschk AT desy DOT de> 2019.5.0.14-1.dz.1
- this is a repackaged version removing .build-id