Fedoar 32 + CUDA 11 + gcc

I’m having some trouble getting CUDA’s nvcc working with Fedora 32. I’ve followed the rpmfusion instructions (https://rpmfusion.org/Howto/CUDA), however, when I try to install GCC9 using the kwizart package (https://rpmfusion.org/Howto/CUDA#GCC_version), I get a conflict with the existing version of GCC:

Error: 
 Problem: problem with installed package gcc-10.2.1-1.fc32.x86_64
  - package gcc-10.2.1-1.fc32.x86_64 requires cpp = 10.2.1-1.fc32, but none of the providers can be installed
  - package gcc-10.0.1-0.11.fc32.x86_64 requires cpp = 10.0.1-0.11.fc32, but none of the providers can be installed
  - cannot install both cpp-9.3.1-3.fc32.x86_64 and cpp-10.2.1-1.fc32.x86_64
  - cannot install both cpp-10.2.1-1.fc32.x86_64 and cpp-9.3.1-3.fc32.x86_64
  - cannot install both cpp-10.0.1-0.11.fc32.x86_64 and cpp-9.3.1-3.fc32.x86_64
  - package cuda-gcc-9.3.1-3.fc32.x86_64 requires cpp = 9.3.1-3.fc32, but none of the providers can be installed
  - conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)

Adding the --allowerasing flag would remove a bunch of packages that depend on GCC (including CUDA!). cuda-gcc would install with the cuda-gcc-10.1 repo without any conflicts, however, that compiler does not work on F32 due to another depedency issue. Any suggestions for getting GCC9 installed along side the system GCC10? Thanks!

1 Like

Not GCC 9, but negativo17’s fedora-multimedia package repo contains a cuda-gcc package built on GCC 8.3.0, which is totally standalone (it pulls in its own cuda-gcc-c++ for the C++ compiler) and totally compatible with both the RPM Fusion and Nvidia CUDA packages.

dnf config-manager --add-repo=https://negativo17.org/repos/fedora-multimedia.repo

To install the repo.

I’d also report a bug @ rpm fusion regarding the cuda-gcc-9.3.1 package. (Since it’s a COPR repo I guess it’s not really RPM Fusion’s problem.) I don’t think it’s intended to require a backrev system cpp, but I’m not sure.

Oh, wait, actually: Did you follow the instructions at https://rpmfusion.org/Howto/CUDA#GCC_version exactly, including telling DNF to install both cuda-gcc and cuda-gcc-c++ in the same command? If there’s a cuda-gcc-c++ in that COPR that supplies cpp, it may just have been a dependency resolution error that caused it to not be picked up automatically.

(In fact, now that I look that COPR repo supplies the exact same cuda-gcc{,-c++}-8.3.0 version as negativo17’s repo.)

I also just tried it myself, and sudo dnf install cuda-gcc cuda-gcc-c++ gave me no conflicts with any of the existing C++ compiler packages on my system, of which there are like 5.

1 Like

The issue here appears to be that the requirements for fedora-multimedia (negativo17) cuda-gcc are:

$ sudo dnf repoquery --repo=fedora-multimedia --requires cuda-gcc
Last metadata expiration check: 0:03:22 ago on Wed 26 Aug 2020 06:25:56 PM EDT.
binutils
libc.so.6(GLIBC_2.14)(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.3)(64bit)
libgcc_s.so.1(GCC_3.4)(64bit)
libgcc_s.so.1(GCC_4.2.0)(64bit)
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3.9)(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
rtld(GNU_HASH)

Whereas @kwizart’s package requires:

$ sudo dnf repoquery --repo=copr:copr.fedorainfracloud.org:kwizart:cuda-gcc-10.1 --requires cuda-gcc
Last metadata expiration check: 0:12:30 ago on Wed 26 Aug 2020 06:16:32 PM EDT.
binutils
flex
gcc
gcc-c++
gmp-devel >= 4.3.2
isl-devel >= 0.15
libc.so.6(GLIBC_2.14)(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.3)(64bit)
libgcc_s.so.1(GCC_3.4)(64bit)
libgcc_s.so.1(GCC_4.2.0)(64bit)
libmpc-devel >= 0.8.1
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3.9)(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
mpfr-devel >= 2.4.2
rtld(GNU_HASH)
zlib-devel

So, if the install still fails because you don’t have all of the requisite tools installed, it’s likely DNF is trying to pull them in and picking the wrong versions. So one thing you can do is just sudo dnf install gcc gcc-c++ libmpc-devel mpfr-devel zlib-devel isl-devel gmp-devel flex binutils beforehand, without the COPR packages, to make sure all of those packages are fully sorted out. Then the COPR packages should install cleanly.

If that works, then this is still a bug with Kwizart’s cuda-gcc packages probably, since it doesn’t seem like they should be requiring things like (especially) gcc and gcc-c++.

1 Like

Thanks for the suggestions, @ferdnyc. I should have mentioned it in my original post, but I’m using the cuda-11 version of the @kwizart repo: https://copr.fedorainfracloud.org/coprs/kwizart/cuda-gcc-11/. I had the cuda-10.2 previously installed fine (although it wouldn’t actually compile anything on F32, as there was an version issue with mpfr). The cuda-11 version of the repo has a lot more dependencies, including the specific version of cpp that is causing the issue:

$ sudo dnf repoquery --repo=copr:copr.fedorainfracloud.org:kwizart:cuda-gcc-11 --requires cuda-gcc
Last metadata expiration check: 2:29:34 ago on Wed 26 Aug 2020 08:10:57 PM EDT.
/lib/libc.so.6
/lib64/libc.so.6
/usr/bin/pod2man
/usr/bin/python
/usr/bin/sh
/usr/lib/libc.so
/usr/lib64/libc.so
binutils >= 2.31
bison
cpp = 9.3.1-3.fc32
dblatex
dejagnu
docbook5-style-xsl
doxygen >= 1.7.1
elfutils-devel >= 0.147
elfutils-libelf-devel >= 0.147
flex
gcc
gcc-c++
gdb
gettext
glibc-devel >= 2.2.90-12
glibc-devel >= 2.4.90-13
glibc-static
gmp-devel >= 4.1.2-8
graphviz
hostname
isl = 0.16.1
isl-devel = 0.16.1
ld-linux-x86-64.so.2()(64bit)
ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libgcc >= 9.3.1-3.fc32
libgmp.so.10()(64bit)
libgomp = 9.3.1-3.fc32
libgomp.so.1()(64bit)
libisl.so.15()(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libmpc-devel >= 0.8.1
libmpc.so.3()(64bit)
libmpfr.so.6()(64bit)
libz.so.1()(64bit)
mpfr-devel >= 2.2.1
procps
python2-devel
python3-devel
python3-sphinx
rtld(GNU_HASH)
sharutils
systemtap-sdt-devel >= 1.3
texinfo
texinfo-tex
texlive-collection-latex
zlib-devel

Are you able to install cuda-gcc from the cuda-11 repo? I may have to just compile GCC8 from source.

Please use the cuda-10.1 copr repository. I have removed the cuda-11 copr version because it doesn’t work fine.

The copr for cuda 10.1 and later works with cuda-11 also

I have updated the doc to remove the cuda-11 copr repository.

You would want to use this [TOOL] NVIDIA Easy Automatic Driver Installer for Fedora 32 Workstation or above. This can easily install everything from drivers to CUDA, to media hardware acceleration support software from the RPM Fusion repository with sane defaults.

Thanks @kwizart! With the 10.1 version of the repo, I got an error when running nvcc that libmpfr.so.4 is missing. However, I was able to build and install that from source (https://www.mpfr.org/mpfr-3.1.6/) which resolved the issue. Looks like everything is working now. Thanks for your help!

Thanks for the suggestion @t0xic0der. I managed to get everything working, but that looks much easier so I’ll definitely give it a try next time I set up a new system.

1 Like