Hi. Opensubdiv requires <gcc-9 as a default compiler and gives an error message otherwise that cuda requires gcc < 9. This is outdated: cuda-11 has gcc-9 in the compatibility list. 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 } Reproducible: Always
I agree that users of cuda-11 should be permitted to use later versions of gcc, but the fix is not so simple. For example the graphics card in one of my systems only supports sm_30 which was deprecated in cuda 11. Cuda 10 will support sm_30, but only allows gcc-8. When I have selected gcc-9 with gcc-config on that system, opensubdiv fails to compile as nvcc fails with /opt/cuda/include/crt/host_config.h:138:2: error: #error -- unsupported GNU version! gcc versions later than 8 are not supported! Currently the requirements are <=nvidia-cuda-toolkit-9.0 ( <=sys-devel/gcc-5.4 ) nvidia-cuda-toolkit-9.1 ( <=sys-devel/gcc-6.4 ) nvidia-cuda-toolkit-9.2 to 10.1 ( <=sys-devel/gcc-7.3 ) nvidia-cuda-toolkit 10.1 to 10.2 ( <=sys-devel/gcc-8.4 ) nvidia-cuda-toolkit-11.0 ( <=sys-devel/gcc-9.3 ) nvidia-cuda-toolkit-11.1 ( <=sys-devel/gcc-10.4 ) Putting this testing in every ebuild that uses nvcc at build time is fragile and will be easily broken by updates to nvidia-cuda-toolkit. The user has already been warned about this in a message that appears when installing nvidia-cuda-toolkit. I plan to remove the gcc version checking from pkg_pretend, as the problem is not with opensubdiv itself, but whether the currently selected version of gcc supports the installed version of nvidia-cuda-toolkit. If users do require selection of different gcc versions for different packages (eg. chromium requires >= gcc 9.2, but nvidia-cuda-toolkit-10 requires gcc < 9), they can select the latest version with gcc-config, and then override the gcc version on a per package basis using /etc/portage/env/gcc-8.4.0.conf PATH="/usr/x86_64-pc-linux-gnu/gcc-bin/8.4.0:${PATH}" CC="/usr/x86_64-pc-linux-gnu/gcc-bin/8.4.0/gcc" CXX="/usr/x86_64-pc-linux-gnu/gcc-bin/8.4.0/g++" and /etc/portage/package.env/oldgcc dev-util/nvidia-cuda-toolkit gcc-8.4.0.conf media-libs/opensubdiv gcc-8.4.0.conf
I agree with this problem is outside the scope of opensubdiv. It should be solved in cuda ebuild, if possible at all. Opensubdiv should not even make these checks.
Hello, to me it seems that opensubdiv ebuild really shouldn't tell which version of gcc I should have. This is between cuda and cuda-toolkit and you should only depend on e.g. specific version of cuda toolkit, if opensubdiv needs that(it probably doesn't). Removing mentioned part in pkg_pretend helps.
Opensubdiv can work with any version of cuda, providing that the card supports it and the correct version of gcc is also used. But if the user selects an incompatible version using gcc-config even after building, then opensubdiv fails at runtime (for example when called from blender) There is a message warning about this in the nvidia-cuda-toolkit ebuild as you mention. In pull request 18663, I have removed the checks from package pretend which allows you to attempt to compile opensubdiv with the current gcc version. I have placed checks and a warning message in src_configure so that if you attempt to use an unsupported version a message will be given to aid troubleshooting should the build fail. In that PR I also add the ability to specify which compute capabilities to compile against, as that must also be compatible with the chosen nvidia-cuda-toolkit. I hope it gets merged soon as it allows you to optimise your system based on your actual graphics card. I would appreciate any feedback
Adrian, needed to solve this so I stumbled upon version from CG overlay and found interesting patches there, taking care (not only) about mentioned sm_30 issue.. Maybe this can help: https://github.com/brothermechanic/cg/tree/master/media-libs/opensubdiv Simply removing the gcc version check can easily end up in same(or different) sm_30 missing error as you stated before(sthg between nvcc and opensubdiv), pardon my former comment..
Can we perhaps start thinking about turning the feature off if it can't be made to work with later GCCs? This is impossible to test. GCC-10 is already current stable!
Being able to use cuda for opensubdiv is important as having gpu accelerated subdivision surface rendering allows more rapid computation for creating smoothed curves which are used on almost every sculpted model, and is especially useful when creating cloth simulation for animation, or rendering large scenes in blender. The issue is nvidia-cuda-toolkit's support for gcc, not opensubdiv which can work with new and old versions of gcc providing the user has an appropriate graphics card and version of the toolkit installed. For example opensubdiv[cuda] can work with gcc 10, but it requires nvidia-cuda-toolkit 11, and this requires a graphics card of at least Nvidia Pascal architecture. Users of older graphics cards will need to use previous versions of nvidia-cuda-toolkit, which are still in the tree, but only support up to gcc 8. As this includes my laptop I am ensuring that this configuration still works.
can we add a use flag like nogcccheck or usegcc8?
(In reply to Adrian from comment #7) > Being able to use cuda for opensubdiv is important as having gpu accelerated > subdivision surface rendering allows more rapid computation for creating > smoothed curves which are used on almost every sculpted model, and is > especially useful when creating cloth simulation for animation, or rendering > large scenes in blender. > > The issue is nvidia-cuda-toolkit's support for gcc, not opensubdiv which can > work with new and old versions of gcc providing the user has an appropriate > graphics card and version of the toolkit installed. > > For example opensubdiv[cuda] can work with gcc 10, but it requires > nvidia-cuda-toolkit 11, and this requires a graphics card of at least Nvidia > Pascal architecture. > > Users of older graphics cards will need to use previous versions of > nvidia-cuda-toolkit, which are still in the tree, but only support up to gcc > 8. As this includes my laptop I am ensuring that this configuration still > works. Minor correction, it requires Maxwell or greater cards. Nvidia has not yet deprecated Maxwell, but Kepler and below have been basically deprecated by Nvidia upstream. SM_50 is the generation I'm on, thankfully. Though, it might be a while before I can get my hands on something better.
*** Bug 819897 has been marked as a duplicate of this bug. ***
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc0a2d9cd04c458e48543abea41bba7882913e93 commit fc0a2d9cd04c458e48543abea41bba7882913e93 Author: Alexander Golubev <fatzer2@gmail.com> AuthorDate: 2021-11-06 23:14:33 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2021-11-22 14:10:19 +0000 media-libs/opensubdiv: use cuda eclass * Utilize cuda eclass and let it handle gcc selection instead of forcing an outdated version. * Add a fix to provide sane defaults when compiling against a recent enough CUDA versions. * Add an option to pass user-specified NVCCFLAGS and prevent cmake from overriding them. Closes: https://bugs.gentoo.org/744517 Closes: https://bugs.gentoo.org/751382 Signed-off-by: Alexander Golubev <fatzer2@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/22852 Signed-off-by: Joonas Niilola <juippis@gentoo.org> ...opensubdiv-3.4.4-add-CUDA11-compatibility.patch | 19 +++++ media-libs/opensubdiv/opensubdiv-3.4.4-r2.ebuild | 93 ++++++++++++++++++++++ 2 files changed, 112 insertions(+)