Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 811054 - media-libs/opensubdiv-3.4.3 with cuda fails on gcc 9 or higher
Summary: media-libs/opensubdiv-3.4.3 with cuda fails on gcc 9 or higher
Status: RESOLVED DUPLICATE of bug 744517
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Adrian
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-29 23:16 UTC by Austin Kilgore
Modified: 2021-08-30 06:16 UTC (History)
3 users (show)

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


Attachments
build.log (opensubdiv-3.4.3-build.log,1.65 KB, text/x-log)
2021-08-29 23:29 UTC, Austin Kilgore
Details
build.log from edited ebuild (opensubdiv-3.4.3-edited-ebuild-build.log,185.38 KB, text/plain)
2021-08-30 04:49 UTC, Austin Kilgore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Austin Kilgore 2021-08-29 23:16:10 UTC
[31;01m*[0m USE=cuda requires gcc < 9. Run gcc-config to switch your default compiler
 [31;01m*[0m ERROR: media-libs/opensubdiv-3.4.3::gentoo failed (pretend phase):
 [31;01m*[0m   Need gcc version earlier than 9

Reproducible: Always

Steps to Reproduce:
emerge opensubdiv
Actual Results:  
fails on gcc 11 (or gcc 9 and up)

Expected Results:  
support for current gcc version

Portage 3.0.22 (python 3.9.6-final-0, default/linux/amd64/17.1/no-multilib, gcc-11.2.0, glibc-2.33-r7, 5.13.13-gentoo-dist x86_64)
=================================================================
System uname: Linux-5.13.13-gentoo-dist-x86_64-AMD_Ryzen_9_5900HS_with_Radeon_Graphics-with-glibc2.33
KiB Mem:    15778264 total,  10644092 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 29 Aug 2021 20:21:22 +0000
Head commit of repository gentoo: a3e895448e101efdb10cddeda369dbf2faebdbee

sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.34.0-r2::gentoo
dev-lang/python:          2.7.18_p11::gentoo, 3.9.6_p1::gentoo, 3.10.0_rc1_p1::gentoo
dev-lang/rust:            1.54.0::gentoo
dev-util/cmake:           3.21.2::gentoo
sys-apps/baselayout:      2.7-r3::gentoo
sys-apps/openrc:          0.43.5::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.16.4::gentoo
sys-devel/binutils:       2.37_p1::gentoo
sys-devel/gcc:            11.2.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo
    priority: -1000
    sync-git-verify-commit-signature: true

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
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"
CXXFLAGS="-march=native -O3 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS=" --with-bdeps y --complete-graph y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O3 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O3 -pipe"
GENTOO_MIRRORS="https://gentoo.osuosl.org/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j16"
PKGDIR="/var/cache/binpkgs"
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="/var/tmp"
USE="10bit 12bit 24-bit-color 24bpp 256-color 7z 7za 7zip 8bit X a52 aac aacplus aacs acl acpi activities airdrop-ng airgraph-ng airplay airspy alsa alsa-plugin amd64 androiddump aptx archive asm aspell async async-connect asyncns atm audio backend-X backend-fbcon backend-gtk3 backend-sdl bash bash-completion bdplus bluetooth bluetooth-sound bluez bluray bmp boot branding brightness-control brotli browser browser-integration bzip2 cairo ccdda cdaudio cdda cddb cdio cdr cdrom cjk cli color-management color-output colord colordiff compression crypt css cuda cudnn cue cups curl cursor cursors dav1d dbus dds declarative display-manager dmenu dri dri3 drm dts dvb dvd dvda dvdarchive dvdr elogind emboss encode eselect evdev exif faudio ffmpegsource ffmpegthumbnailer flac fluidsynth fontconfig fontforge fonts fortran freetype frei0r gdbm gif git github gles2 gles3 glide gold gpm gtk gui haptic hires iconv icu ipv6 jpeg kde kipi kwallet ladspa lame lcms libglvnd libnotify libtirpc lm-sensors lto lz4 lzma lzo macosx-notifications mad mng mp3 mp4 mpd mpeg mpg123 ncurses networkmanager nls nptl nvdec nvenc nvidia nvme ogg openal opencl opencv opengl openh264 openimageio openmp pam pango parallel-compiler passthrough pci pcre pda pdf pgo phonon plasma plugins png policykit ppds progress-meter pthread pthreaded-ubik pulseaudio qemu qml qt5 readline sdl seccomp semantic-desktop spell spice split-usr ssl startup-notification svg tcpd threads tiff truetype udev udisks unicode unzip upower usb usbredir v4l v4l2 v4lutils vaapi vainfo vbox vboxwebsrv vbr vdpau vector-icons vhost-net vhost-user-fs video video-glide64mk2 video-rice video-thumbnails vim vim-syntax virgl virt-network virtfs virtual-io virtualbox virtualkeyboard visualizer vkd3d vlc vmware vnc vocoder voice vorbis vulkan vulkan-overlay wallpaper wallpapers wav wavpack wayland wayland-compositor webp widgets wifi wiimote wireless wireshark-plugins wxwidgets x11-backend x11vnc x264 x265 xattr xcb xcomposite xdg xen xml xrandr xrender xspice xv xvid xwayland zfs zink zip zip-encryption zlib zsh-completion zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU NVPTX X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_SOFTMMU_TARGETS="arm x86_64 i386 aarch64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi radeon nvidia qxl virgl virtualbox vmware" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 1 Austin Kilgore 2021-08-29 23:29:05 UTC
Created attachment 736738 [details]
build.log
Comment 2 Austin Kilgore 2021-08-29 23:37:28 UTC
I seem to be having some issues emerging support for both opencl and cuda.

The thing is I have a AMDGPU iGPU and a Nvidia dGPU so technically I should be able to have both right?

So anyways this package builds with -opencl and -cuda fwiw.

Not sure if this extra information is helpful to my recent bug reports but I'm trying to dig deeper into these errors and find the root causes to help out if possible.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-30 03:05:50 UTC
I don't have a nvidia card so I can't really test this with GCC 9+.

Could you modify the ebuild in your overlay and see if it works with GCC 9 or 10?

Interestingly, I don't see any mention of this upstream.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-30 03:08:42 UTC
(In reply to Sam James from comment #3)
> I don't have a nvidia card so I can't really test this with GCC 9+.
> 
> Could you modify the ebuild in your overlay and see if it works with GCC 9
> or 10?
> 

See https://wiki.gentoo.org/wiki/Custom_ebuild_repository#Creating_a_local_repository for how to do this. Copy the ebuild in once it's created and drop the bits about GCC 9:

pkg_pretend() {
	if use cuda; then
		[[ $(gcc-major-version) -gt 8 ]] && \
		eerror "USE=cuda requires gcc < 9. Run gcc-config to switch your default compiler" && \
		die "Need gcc version earlier than 9"
	fi
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}

You can delete that whole definition of pkg_pretend.
Comment 5 Austin Kilgore 2021-08-30 04:49:11 UTC
(In reply to Sam James from comment #4)
> (In reply to Sam James from comment #3)
> > I don't have a nvidia card so I can't really test this with GCC 9+.
> > 
> > Could you modify the ebuild in your overlay and see if it works with GCC 9
> > or 10?
> > 
> 
> See
> https://wiki.gentoo.org/wiki/
> Custom_ebuild_repository#Creating_a_local_repository for how to do this.
> Copy the ebuild in once it's created and drop the bits about GCC 9:
> 
> pkg_pretend() {
> 	if use cuda; then
> 		[[ $(gcc-major-version) -gt 8 ]] && \
> 		eerror "USE=cuda requires gcc < 9. Run gcc-config to switch your default
> compiler" && \
> 		die "Need gcc version earlier than 9"
> 	fi
> 	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
> }
> 
> You can delete that whole definition of pkg_pretend.

I wasn't able to setup the custom local ebuild based off that wiki page, it just seemed too confusing to me.

What I wound up doing was edit the ebuild that I already had in /var/db/repos/ and remove those lines you said to remove.

This was the error I got when I emerged that ebuild:

CMake Error at osd_static_gpu_generated_cudaKernel.cu.o.Gentoo.cmake:222 (message):
  Error generating
  /var/tmp/portage/media-libs/opensubdiv-3.4.3/work/opensubdiv-3.4.3_build/opensubdiv/CMakeFiles/osd_static_gpu.dir/osd/./osd_static_gpu_generated_cudaKernel.cu.o
Comment 6 Austin Kilgore 2021-08-30 04:49:42 UTC
Created attachment 736750 [details]
build.log from edited ebuild
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-30 05:11:26 UTC
(In reply to Austin Kilgore from comment #5)
> (In reply to Sam James from comment #4)
> > (In reply to Sam James from comment #3)
> > [snip]
> 
> I wasn't able to setup the custom local ebuild based off that wiki page, it
> just seemed too confusing to me.
> 
> What I wound up doing was edit the ebuild that I already had in
> /var/db/repos/ and remove those lines you said to remove.

No problem, that's fine!

So, the real error is:

/opt/cuda/bin/nvcc -M -D__CUDACC__ /var/tmp/portage/media-libs/opensubdiv-3.4.3/work/OpenSubdiv-3_4_3/opensubdiv/osd/cudaKernel.cu -o /var/tmp/portage/media-libs/opensubdiv-3.4.3/work/opensubdiv-3.4.3_build/opensubdiv/CMakeFiles/osd_static_gpu.dir/osd/osd_static_gpu_generated_cudaKernel.cu.o.NVCC-depend -ccbin /usr/bin/x86_64-pc-linux-gnu-gcc -m64 -DOPENSUBDIV_VERSION_STRING=\"3.4.3\" -DOPENSUBDIV_HAS_OPENGL -DOSD_USES_INTERNAL_GLAPILOADER -DOPENSUBDIV_HAS_OPENMP -DGLFW_VERSION_3 -DOPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK -DOPENSUBDIV_HAS_GLSL_COMPUTE -DOPENSUBDIV_HAS_CUDA -DCUDA_ENABLE_DEPRECATED=0 -Xcompiler ,\"-march=native\",\"-O3\",\"-pipe\" -Xcompiler -fPIC --gpu-architecture compute_30 -DNVCC -I/opt/cuda/include -I/var/tmp/portage/media-libs/opensubdiv-3.4.3/work/OpenSubdiv-3_4_3/opensubdiv -I/usr/include -I/var/tmp/portage/media-libs/opensubdiv-3.4.3/work/OpenSubdiv-3_4_3/glLoader
nvcc fatal   : Value 'compute_30' is not defined for option 'gpu-architecture'
[31mCMake Error at osd_static_gpu_generated_cudaKernel.cu.o.Gentoo.cmake:222 (message):
  Error generating
  /var/tmp/portage/media-libs/opensubdiv-3.4.3/work/opensubdiv-3.4.3_build/opensubdiv/CMakeFiles/osd_static_gpu.dir/osd/./osd_static_gpu_generated_cudaKernel.cu.o

which seems to be https://github.com/PixarAnimationStudios/OpenSubdiv/issues/965

... which seems to be bug 744517.

*** This bug has been marked as a duplicate of bug 744517 ***
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-30 05:12:46 UTC
Can you try the workarounds listed in that bug and let me know if it works?

You'll need to add something like:
-DOSD_CUDA_COMPUTE_CAPABILITIES="compute_30"
into 'mycmakeargs'.

Just add it as a new line under '-DNO_TUTORIALS=$(usex !tutorials)' but before the ).
Comment 9 Ionen Wolkens gentoo-dev 2021-08-30 05:21:29 UTC
This is probably what you want to try:

MYCMAKEARGS="-DOSD_CUDA_NVCC_FLAGS='--gpu-architecture;sm_35'" \
    emerge -1 opensubdiv
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-30 05:26:28 UTC
(In reply to Ionen Wolkens from comment #9)
> This is probably what you want to try:
> 
> MYCMAKEARGS="-DOSD_CUDA_NVCC_FLAGS='--gpu-architecture;sm_35'" \
>     emerge -1 opensubdiv

Oh, that's it. Ugh.
Comment 11 Austin Kilgore 2021-08-30 06:16:30 UTC
Can confirm that fixed it.

I definitely need to be more thorough with checking these bugs and not make duplicate reports...