Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 722092 - dev-util/nvidia-cuda-sdk-10.2.89 should downgrade CFLAGS
Summary: dev-util/nvidia-cuda-sdk-10.2.89 should downgrade CFLAGS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
Depends on:
Reported: 2020-05-10 09:29 UTC by Alexey
Modified: 2021-03-12 09:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

build.log (build.log,66.53 KB, text/x-log)
2020-05-10 09:29 UTC, Alexey
emerge --info (file_722092.txt,19.41 KB, text/plain)
2020-05-10 09:30 UTC, Alexey
ebuild for nvidia-cuda-sdk-11.1.1 (nvidia-cuda-sdk-11.1.1.ebuild,3.73 KB, text/plain)
2021-03-11 21:57 UTC, sylvain.miossec

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey 2020-05-10 09:29:44 UTC
Created attachment 637500 [details]

cc1plus: error: bad value (‘znver2’) for ‘-march=’ switch
cc1plus: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server bonnell atom silvermont slm knl knm x86-64 ed
en-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 native; did you mean ‘znver1’?

Because it requires gcc 8 which doesn't support znver2. It should do something similar to downgrade_arch_flags from toolchain.eclass. Probably that function should be moved to some other eclass to be used from non-gcc ebuild like this one?
Comment 1 Alexey 2020-05-10 09:30:10 UTC
Created attachment 637502 [details]
emerge --info
Comment 2 sylvain.miossec 2021-02-25 11:55:04 UTC
I have the same problem with a ryzen 3900X processor. I suppose I can force CFLAGS to znver1 instead of znver2 for this package to solve it. I did not try yet.
Comment 3 Benda Xu gentoo-dev 2021-02-25 15:13:22 UTC
Patches welcome.
Comment 4 sylvain.miossec 2021-03-11 21:57:52 UTC
Created attachment 690876 [details]
ebuild for nvidia-cuda-sdk-11.1.1
Comment 5 sylvain.miossec 2021-03-11 21:59:00 UTC
I finally preferred to use cuda 11 that use gcc 9.3 that support znver2. So I modified ebuild for version 11.1.1, see attached file. Need some more testing.

I had some compilation core dump, but when continuing compilation did not reproduce (with ebuild nvidia-cuda-sdk***.ebuild compile). So I suppose it is a race condition problem, but did not investigate for now.

I also tried with cuda 11.2.0, but had many segmentation faults with cicc. Not systematically reproducible. I could compile it by repeating maybe 20 times "ebuild nvidia-cuda-sdk***.ebuild compile". Maybe something to do with this bug

Hope this helps.
Comment 6 sylvain.miossec 2021-03-12 09:50:43 UTC
I tested 
MAKEOPTS="-j1" emerge --ask nvidia-cuda-sdk
and indeed nvidia-cuda-sdk-11.1.1 compiles fine. So core dump pb I had seem to be a problem of compilation of sdk on multiple cores.