Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 638230 - dev-util/nvidia-cuda-toolkit-9.0.176 (probably v8.x too): _BITS_FLOATN_H must be defined for glibc >= 2.26
Summary: dev-util/nvidia-cuda-toolkit-9.0.176 (probably v8.x too): _BITS_FLOATN_H must...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
: 639548 643814 645688 646108 646110 646852 (view as bug list)
Depends on:
Blocks: glibc-2.26
  Show dependency tree
 
Reported: 2017-11-20 16:41 UTC by Andreas Steinmetz
Modified: 2020-12-27 16:37 UTC (History)
12 users (show)

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


Attachments
Fix for glibc-2.26 (cuda-9-glibc-2.26-floatn.patch,287 bytes, patch)
2017-12-18 19:47 UTC, Daniel M. Weeks
Details | Diff
Patched ebuild for glibc 2.26 (nvidia-cuda-toolkit-9.1.85-r1.ebuild,3.33 KB, text/plain)
2018-02-18 03:39 UTC, Samuel Bernardo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Steinmetz 2017-11-20 16:41:14 UTC
Every package depending on nvidia-cuda-toolkit will fail to emerge if glibc >= 2.26 is installed due to _BITS_FLOATN_H not being defined with:

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"
/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

The solution is to define _BITS_FLOATN_H in /opt/cuda/include/host_defines.h as e.g. done in the following link:

https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/cuda&id=ae90e4d243510e9565e66e9e8e08c509f5719fe0
Comment 1 Risto A. Paju 2017-11-21 11:47:38 UTC
Bug confirmed: tested building https://github.com/tpruvot/ccminer/ which fails with the messages

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined


The proposed solution

sed -i "1 i#define _BITS_FLOATN_H" /opt/cuda/include/host_defines.h

works, and ccminer now builds succesfully.
Comment 2 blopsalot 2017-12-11 00:36:02 UTC
here's a glibc patch that's less destructive.

src: https://www.reddit.com/r/archlinux/comments/6zrmn1/torch_on_arch/

--- a/usr/include/bits/floatn.h 2017-09-13 16:00:37.079654880 +0200
+++ b/usr/include/bits/floatn.h 2017-09-13 16:00:00.999104815 +0200
@@ -28,7 +28,8 @@
    support, for x86_64 and x86.  */
 #if (defined __x86_64__                            \
      ? __GNUC_PREREQ (4, 3)                        \
-     : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4)))
+     : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \
+  &&  !defined(__CUDACC__)
 # define __HAVE_FLOAT128 1
 #else
 # define __HAVE_FLOAT128 0
Comment 3 Justin Bronder (RETIRED) gentoo-dev 2017-12-11 13:16:38 UTC
*** Bug 639548 has been marked as a duplicate of this bug. ***
Comment 4 Daniel M. Weeks 2017-12-18 19:47:51 UTC
Created attachment 510796 [details, diff]
Fix for glibc-2.26

Based on the Arch workaround, I propose the attached patch which is a little more selective than the original.
Comment 5 younky.yang 2017-12-19 02:00:27 UTC
(In reply to Daniel M. Weeks from comment #4)
> Created attachment 510796 [details, diff] [details, diff]
> Fix for glibc-2.26
> 
> Based on the Arch workaround, I propose the attached patch which is a little
> more selective than the original.

How can i use epatch to patch the installed file? Or i have to use this manually after the source package unpacked?
Comment 6 vtalov 2017-12-19 03:10:59 UTC
> How can i use epatch to patch the installed file?

Maybe this would be helpful:

https://wiki.gentoo.org/wiki//etc/portage/patches
Comment 7 Daniel M. Weeks 2017-12-19 03:28:08 UTC
(In reply to younky.yang from comment #5)
> (In reply to Daniel M. Weeks from comment #4)
> > Created attachment 510796 [details, diff] [details, diff] [details, diff]
> > Fix for glibc-2.26
> > 
> > Based on the Arch workaround, I propose the attached patch which is a little
> > more selective than the original.
> 
> How can i use epatch to patch the installed file? Or i have to use this
> manually after the source package unpacked?

Either apply just the patch as vtalov suggested in comment #6 or you can use the junkdrawer overlay which has the patch and an updated version (cuda 9.1).
Comment 8 blopsalot 2018-01-07 14:10:52 UTC
(In reply to Daniel M. Weeks from comment #4)
> Created attachment 510796 [details, diff] [details, diff]
> Fix for glibc-2.26
> 
> Based on the Arch workaround, I propose the attached patch which is a little
> more selective than the original.

This is a clang issue, it is not unique to cuda. it took a while for gcc to sort out libquadmath too. 

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43622
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20170522/193832.html
Comment 9 Marius Brehler 2018-01-09 07:46:32 UTC
*** Bug 643814 has been marked as a duplicate of this bug. ***
Comment 10 Samuel Bernardo 2018-01-18 01:10:55 UTC
When applying the patch in attachment receive the following error message when compiling nvidia-cuda-sdk-9.0.176:

 * Applying glibc-2.26.patch ...
The text leading up to this was:
--------------------------
|--- include/host_defines.h     2017-12-18 14:14:28.151154536 -0500
|+++ include/host_defines.h     2017-12-18 14:17:01.927019796 -0500
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Comment 11 Ivan Dorna 2018-01-30 08:49:30 UTC
I append here what I have defined in bug #646108 related to the latest (30/01/2018) glibc-2.26-r5 and dev-util/nvidia-cuda-sdk-9.1.85 where the problem it's the same to the original problem definition. adding also links to other distro paches to this problem.

portage can't permit rollback from sys-libs/glibc-2.26 to 2.25 due system braking check (good!) but if the system it's updated to glibc 2.26 there are compatibility problems in /usr/include/bits/floatn.h definitions of "float128"  checked by packages dependent on all versions of Nvidia cuda 8.x 9.0.x 9.1.x.

Seems the problem it's "only" related to header definitions of float128

I know that it's not (probably) strictly a bug of sys-libs/glibc a but cause a base system incompatibility problem without the possibility to rollback, so can be a nice thing have a patch to provide system compatibility about glibc-2.25 and glibc-2.26 about float128 definition.

I report other links as bibliography of the problem, an example of compilation, 
and emerge --info result.

Links:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1717257

https://devtalk.nvidia.com/default/topic/1023776/-request-add-nvcc-compatibility-with-glibc-2-26/

https://aur.archlinux.org/packages/ccminer-git/


Compilation Example and emerge --info output

:pts/3: [root@box01] /Data/Data01/Miner/xmr-stak-2.2.0 #> make install
-- Set miner currency to 'monero' and 'aeon'
fatal: Not a git repository (or any parent up to mount point /Data)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: Not a git repository (or any parent up to mount point /Data)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-- Configuring done
-- Generating done
-- Build files have been written to: /Data/Data01/Miner/xmr-stak-2.2.0
[ 17%] Built target xmr-stak-c
[ 67%] Built target xmr-stak-backend
[ 70%] Building NVCC (Device) object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_extra.cu.o
/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

2 errors detected in the compilation of "/tmp/tmpxft_00001da0_00000000-14_cuda_extra.compute_70.cpp1.ii".
CMake Error at xmrstak_cuda_backend_generated_cuda_extra.cu.o.Release.cmake:279 (message):
  Error generating file
  /Data/Data01/Miner/xmr-stak-2.2.0/CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/./xmrstak_cuda_backend_generated_cuda_extra.cu.o


make[2]: *** [CMakeFiles/xmrstak_cuda_backend.dir/build.make:353: CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_extra.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/xmrstak_cuda_backend.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
:pts/3: [root@box01] /Data/Data01/Miner/xmr-stak-2.2.0 #> nano /usr/include/bits/floatn.h
:pts/3: [root@box01] /Data/Data01/Miner/xmr-stak-2.2.0 #> emerge --info
Portage 2.3.20 (python 3.6.4-final-0, default/linux/amd64/17.0/systemd, gcc-6.4.0, glibc-2.26-r5, 4.12.3-gentoo x86_64)
=================================================================
System uname: Linux-4.12.3-gentoo-x86_64-Intel-R-_Core-TM-_i7-7700K_CPU_@_4.20GHz-with-gentoo-2.4.1
KiB Mem:    65790780 total,  53534764 free
KiB Swap:   64652280 total,  64652280 free
Timestamp of repository gentoo: Mon, 29 Jan 2018 00:45:01 +0000
sh bash 4.4_p12-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
ccache version 3.3.4 [disabled]
app-shells/bash:          4.4_p12-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo, 3.6.4::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.10.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo, 7.2.0-r1::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r5::gentoo
Repositories:

gentoo
    location: /ports/portage
    sync-type: webrsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

science
    location: /var/lib/layman/science
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -Wno-error -Wl,-z -Wl,now -Wl,-z -Wl,relro -Wl,-z,max-page-size=0x1000 -ftree-vectorize -ftree-loop-vectorize -fopt-info-vec -march=native -mtune=native -fasynchronous-unwind-tables -fno-omit-frame-pointer -Wp,-D_REENTRANT"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/entropy /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -Wno-error -Wl,-z -Wl,now -Wl,-z -Wl,relro -Wl,-z,max-page-size=0x1000 -ftree-vectorize -ftree-loop-vectorize -fopt-info-vec -march=native -mtune=native -fasynchronous-unwind-tables -fno-omit-frame-pointer -Wp,-D_REENTRANT"
DISTDIR="/ports/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=y --autounmask-write --quiet --jobs=1 --keep-going --with-bdeps=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup compressdebug config-protect-if-modified distlocks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
LINGUAS="en"
MAKEOPTS="-j8"
PKGDIR="/ports/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/ports/tmp"
USE="X acl acpi aes alsa amd64 audit avx berkdb bzip2 c++11 c++14 c++17 clang cli crypt cuda cxx dbus default-compiler-rt default-libcxx dri evdev event eventhandler fortran gdbm glamor gmp gnutls grub gstreamer gtk3 hardened http2 iconv inotify introspction ipc ipmi iproute2 ipv6 ithreads jemalloc jfs kdbus kms kvm lapack libevent libnotify libunwind live lm_sensors logind lz4 lzma lzo mmx mmxext modules multilib ncurses net40 net45 net46 netlink network nls nptl ntfs numa nvcontrol nvenc nvidia opencl opencv opencv3 openexr opengl openh264 openssl pam pcre policykit polkit pulseaudio rar rdma readline reiserfs romio rtmp sasl seccomp smp squashfs sse sse2 sse3 sse4 sse4_1 sse4_2 sse4a ssl ssp ssse3 stream sysfs system-sqlite systemd tcpd tesseract threaded threads udev udisks unicode urandom usb v4l v4l2 vtv vulkan wayland webp webrtc-aec websocket websockets wifi wireless x264 x265 xattr xfs zlib" ABI_X86="64 32" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="agfa_cl20 casio_qv dimagev dimera3500 kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica_qm150 panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l859" COLLECTD_PLUGINS="aggregation ascent battery bind cgroups conntrack contextswitch cpu cpufreq csv curl curl_json curl_xml dbi df disk dns entropy ethstat exec filecount fscache hddtemp interface iptables irq load logfile lvm madwifi match_empty_counter match_hashed match_regex match_timediff match_value mbmon md memcached memory multimeter mysql netlink network nfs nginx notify_email ntpd numa olsrd openvpn ping powerdns processes protocols routeros rrdcached rrdtool sensors serial snmp statsd swap syslog table tail target_notification target_replace target_scale target_set tcpconns ted thermal threshold unixsock uptime users uuid vmem wireless write_graphite write_http ipc modbus python smart tail_csv zfs_arc" CPU_FLAGS_X86="fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp aes avx avx2 f16c fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" ENLIGHTENMENT_MODULES="appmenu backlight battery bluez4 clock conf conf-applications conf-bindings conf-dialogs conf-display conf-interaction conf-intl conf-menus conf-paths conf-performance conf-randr conf-shelves conf-theme conf-window-manipulation conf-window-remembers connman cpufreq everything fileman fileman-opinfo gadman geolocation ibar ibox lokker mixer msgbus music-control notification pager pager-plain quickaccess shot start syscon systray tasks teamwork temperature tiling time winlist wizard wl-weekeyboard wl-wl xkbswitch packagekit" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-32 efi-64 pc emu ieee1275 multiboot qemu coreboot" INPUT_DEVICES="evdev void" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NGINX_MODULES_HTTP="access addition auth_basic auth_pam auth_request autoindex browser cache_purge charset dav dav_ext echo empty_gif fancyindex fastcgi flv geo geoip gunzip gzip headers_more image_filter limit_conn limit_req map memcached metrics mp4 naxsi perl proxy push push_stream random_index realip referer rewrite scgi secure_link slowfs_cache split_clients ssi stub_status sub upload_progress upstream_check upstream_ip_hash userid uwsgi xslt upstream_least_conn upstream_hash upstream_zone upstream_keepalive" NGINX_MODULES_MAIL="imap pop3 smtp" NGINX_MODULES_STREAM="access geo geoip map realip ssl_preread upstream_hash upstream_least_conn upstream_zone" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python3_6 python2_7" QEMU_SOFTMMU_TARGETS="x86_64 arm cris i386 m68k microblaze mips mips64 mips64el mipsel ppc ppc64 ppcemb sh4 sh4eb sparc sparc64 aarch64 moxie tricore unicore32" QEMU_USER_TARGETS="alpha arm armeb cris i386 m68k microblaze mips mipsel ppc ppc64 ppc64abi32 sh4 sh4eb sparc sparc32plus sparc64 x86_64 aarch64" RUBY_TARGETS="ruby23" SANE_BACKENDS="abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_pp cardscan coolscan coolscan2 coolscan3 dc210 dc240 dc25 dell1600n_net dmc epjitsu epson epson2 fujitsu genesys gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpljm1005 hpsj5s hs2p ibm kodak kvs1025 leo lexmark ma1509 matsushita microtek microtek2 mustek mustek_pp mustek_usb nec net niash p5 pie pixma plustek plustek_pp qcam ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax1220u umax_pp xerox_mfp pnm" USERLAND="GNU" VIDEO_CARDS="intel i915 i965 modesetting fbdev vesa" VOICEMAIL_STORAGE="file" XFCE_PLUGINS="clock power trash" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

:pts/3: [root@box01] /Data/Data01/Miner/xmr-stak-2.2.0 #>
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-30 08:50:41 UTC
*** Bug 646108 has been marked as a duplicate of this bug. ***
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-30 08:52:13 UTC
*** Bug 645688 has been marked as a duplicate of this bug. ***
Comment 14 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-30 08:58:07 UTC
*** Bug 646110 has been marked as a duplicate of this bug. ***
Comment 15 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-30 09:04:38 UTC
*** Bug 646110 has been marked as a duplicate of this bug. ***
Comment 16 Jeroen Roovers (RETIRED) gentoo-dev 2018-01-30 09:06:58 UTC
*** Bug 646108 has been marked as a duplicate of this bug. ***
Comment 17 Ivan Dorna 2018-01-30 09:10:12 UTC
merged with #646108 and #646110 that refers to latest versions of glibc and nvidia-cuda-sdk, but the bugs still UNCONFIRMED. on my previous notes there is links related to patch used in other distros.
Comment 18 Craig Andrews gentoo-dev 2018-02-07 02:05:59 UTC
*** Bug 646852 has been marked as a duplicate of this bug. ***
Comment 19 Craig Andrews gentoo-dev 2018-02-07 02:07:47 UTC
What's the plan for fixing this?

I suspect an increasing number of users will encounter this as glibc 2.2.6's use increases (i just had a bug report against a package I maintain [bug 646852], hence my desire to raise attention to this issue).
Comment 20 Samuel Bernardo 2018-02-07 20:39:42 UTC
(In reply to Craig Andrews from comment #19)
> What's the plan for fixing this?
> 
> I suspect an increasing number of users will encounter this as glibc 2.2.6's
> use increases (i just had a bug report against a package I maintain [bug
> 646852], hence my desire to raise attention to this issue).

Arch, that is using glibc 2.26 for awhile, have it working with a more recent version:
https://www.archlinux.org/packages/community/x86_64/cuda/

Looking into their pkgbuild it's possible to do the same in Gentoo:
https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/cuda

I hope to review it next weekend to do the ebuild and put it available in my overlay.

I use Arch for my netbook installation, but my first choice distro is always Gentoo. Nothing is like Gentoo, so let's get working for it!
Comment 21 Samuel Bernardo 2018-02-17 12:08:50 UTC
I have already nvidia-cuda-toolkit-9.1.85 installed from portage with latest available glibc-2.26-r6.

The only problem now is about opencv and nvidia-cuda-sdk that are also needed for cuda environment.
Comment 22 Samuel Bernardo 2018-02-18 03:36:52 UTC
(In reply to Samuel Bernardo from comment #21)
> I have already nvidia-cuda-toolkit-9.1.85 installed from portage with latest
> available glibc-2.26-r6.
> 
> The only problem now is about opencv and nvidia-cuda-sdk that are also
> needed for cuda environment.

To compile nvidia-cuda-sdk with glibc-2.26 it was necessary to add the following sed to the end of src_prepare and before default:

sed -i "50 i#define _BITS_FLOATN_H" "${S}/include/host_defines.h"

I'll add an attachment with the ebuild that I published in my overlay.

Now everything is working as expected.
Comment 23 Samuel Bernardo 2018-02-18 03:39:20 UTC
Created attachment 519910 [details]
Patched ebuild for glibc 2.26

ebuild with additional sed to compile nvidia-cuda-sdk and other cuda dependent ebuilds with glibc 2.26.
Comment 24 Andreas K. Hüttel archtester gentoo-dev 2018-04-28 19:44:37 UTC
@sci: I'd *very* much prefer to fix this without modifying glibc.

That said, since nvidia-cuda-toolkit is ~arch only this won't block glibc-2.26 stabilization.
Comment 25 Marius Brehler 2018-05-28 08:03:28 UTC
This should be fixed with CUDA 9.2, see [1], for which currently a pull request is pending [2].

[1] https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-compiler-resolved-issues
[2] https://github.com/gentoo/gentoo/pull/8632