Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] cuda is not available as its a hard blocked flag
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
russellD
n00b
n00b


Joined: 07 Oct 2014
Posts: 55
Location: 28.5797S,153.338 E

PostPosted: Sun Jan 16, 2022 6:23 pm    Post subject: [SOLVED] cuda is not available as its a hard blocked flag Reply with quote

Hi Gentooers

The cuda flag has become hard blocked and this prevents blender and ffmpeg from using the cuda cores in a nvidia card.

Setting cuda flag in /etc/portage/package.use for blender and ffmpeg doesn't enable access to cuda.

This is is seen as a pair of brackets around the cuda flag in the emerge ouput for blender as below:
Code:
[ebuild   R    ] media-gfx/blender-3.0.0:3.0::gentoo  USE="bullet color-management cycles dds embree ffmpeg fftw fluid gmp jpeg2k nls oidn openal openexr openimageio openmp opensubdiv openvdb pdf potrace pugixml pulseaudio sdl sndfile system-numpy system-python tbb tiff -alembic -collada (-cuda) -debug -doc -headless -jack -jemalloc -man -ndof -osl -standalone -test -valgrind" PYTHON_SINGLE_TARGET="python3_9"


What can be done to fix this?

You help is appreciated!

emerge --info is below:

Code:
$ emerge --info           
Portage 3.0.28 (python 3.9.9-final-0, default/linux/amd64/17.1, gcc-11.2.0, glibc-2.33-r7, 5.15.11-gentoo-beanz-05 x86_64)
=================================================================
System uname: Linux-5.15.11-gentoo-beanz-05-x86_64-Intel-R-_Core-TM-_i7-3740QM_CPU_@_2.70GHz-with-glibc2.33
KiB Mem:    32819904 total,  17782792 free                                   
KiB Swap:   33997820 total,  33997820 free                                   
Timestamp of repository gentoo: Sat, 15 Jan 2022 08:30:01 +0000
sh bash 5.1_p8 
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p8::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.0-r6::gentoo
dev-lang/python:           2.7.18_p13::gentoo, 3.9.9-r1::gentoo, 3.10.0_p1-r1::gentoo
dev-lang/rust:             1.56.1::gentoo
dev-util/cmake:            3.21.4::gentoo
dev-util/meson:            0.59.4::gentoo
sys-apps/baselayout:       2.7-r3::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.25::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/binutils-config: 5.4::gentoo
sys-devel/clang:           12.0.1::gentoo, 13.0.0::gentoo
sys-devel/gcc:             11.2.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/lld:             13.0.0::gentoo
sys-devel/llvm:            12.0.1::gentoo, 13.0.0::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.33-r7::gentoo
sys-libs/libselinux:       3.3::gentoo
Repositories:

custom
    location: /var/calculate/custom-overlay
    masters: calculate gentoo

calculate
    location: /var/db/repos/calculate
    sync-type: calculate
    sync-uri: https://github.com/calculatelinux/calculate.git
    masters: gentoo
    priority: 50

distros
    location: /var/db/repos/distros
    sync-type: calculate
    sync-uri: https://github.com/calculatelinux/distros.git
    masters: calculate gentoo
    priority: 50

gentoo
    location: /usr/portage
    sync-type: calculate
    sync-uri: https://github.com/calculatelinux/gentoo.git
    priority: 50

Installed sets: @autodeps, @custom, @custom.cldxe
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -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/php/apache2-php8.0/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php8.0/ext-active/ /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 -march=native -pipe"
DISTDIR="/var/calculate/distfiles"
EMERGE_DEFAULT_OPTS=" --autounmask --binpkg-changed-deps=n --binpkg-respect-use=y --jobs=4 --quiet-build=n --usepkg-exclude='x11-drivers/nvidia-drivers media-gfx/blender'   "
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles getbinpkg ipc-sandbox merge-sync multilib-strict network-sandbox parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://distfiles.gentoo.org https://mirror.calculate-linux.org/distfiles/level0"
INSTALL_MASK="/etc/systemd /lib*/systemd/*/*.service /usr/lib*/systemd/*/*.service /etc/shorewall*/* -/etc/shorewall*/shorewall*.conf"
LANG="en_AU.utf8"
LC_ALL=""
LDFLAGS="-Wl,--as-needed"
MAKEOPTS="-j2 -l4"
PKGDIR="/var/calculate/packages/x86_64"
PORTAGE_BINHOST="http://miroir.linuxtricks.fr/calculate/grp/x86_64"
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"
SHELL="/bin/bash"
USE="3dnow 3dnowext X a52 aac acl acpi aes alsa amd64 amr audiofile avi avx bittorrent bluetooth box bzip2 cairo caps cdda cddb cdparanoia cgroups chm cli cpudetection cracklib crypt css cue cups dav1d dbus dftk djvu dri dv dvd dvdr dvdread ebook elogind encode exif faac fexif ffmpeg flac flash fma3 fma4 foomaticdb fortran ftp gadu gd gdbm gif gphoto2 gpm gstreamer gtk heif hunspell iconv id3tag idn ieee1394 imagemagick imap introspection ios ipod ipv6 irc jabber jpeg jpeg2k lame libglvnd libnotify libtirpc libwww lm-sensors logrotate lz4 lzo mad matroska mikmod mimap mmx mmxext mp3 mpeg mplayer multilib musepack ncurses networkmanager nfs nls nptl nsplugin nvidia ogg oggvorbis openal opencore-amr openexr opengl openmp opus oscar padlock pam pcre pdf pgo pipewire png policykit popcnt postscript ppp pulseaudio quicktime raw rdesktop readline real samba sasl scanner screencast sdl seccomp semantic-desktop smp smtp speex spell split-usr srt sse sse2 sse3 sse4_1 sse4_2 sse4a ssl ssse3 svg taglib tga theora threads tiff truetype udev udisks unicode upnp upower usb userlocales v4l v4l2 vaapi vcd vdpau vhosts vnc vorbis vpx vulkan wavpack wayland webkit webp wimax win32codecs wmf wxwindows x264 x265 xanim xattr xcomposite xinerama xmp xop xv xvid xvmc zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2020" 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" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx sse sse2 * mmxext" 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 efi-32 pc" INPUT_DEVICES="libinput evdev mutouch synaptics" KERNEL="linux" L10N="en be bg bs cs da de de-1901 el es es-AR es-CL es-ES es-MX et fi fr fr-CA hr hu it kk lt lv nl pl pt pt-BR pt-PT ro ru sk sl sr sq sv uk" LCD_DEVICES="* bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" 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 python2_7" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="nvidia" 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:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS


Last edited by russellD on Sun Jan 23, 2022 12:07 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Sun Jan 16, 2022 7:07 pm    Post subject: Reply with quote

The means the use flag is masked, you can unmask it with /etc/portage/profile/package.use.mask or /etc/portage/profile/use.mask.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
russellD
n00b
n00b


Joined: 07 Oct 2014
Posts: 55
Location: 28.5797S,153.338 E

PostPosted: Tue Jan 18, 2022 2:55 am    Post subject: Reply with quote

Hi fedeliallalinea,

thank you for pointing me in the right direction!

fedeliallalinea wrote:
The means the use flag is masked, you can unmask it with /etc/portage/profile/package.use.mask or /etc/portage/profile/use.mask.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21489

PostPosted: Tue Jan 18, 2022 4:39 pm    Post subject: Reply with quote

Usually, flags are masked for a good reason, such as an expectation that enabling the flag will lead to a broken build or that it enables a feature with a known serious security problem. Therefore, I suggest that you find why the flag is masked before you override it.

I made an initial attempt to run this down when I first saw this thread, but found nothing to explain your specific problem. I found:
Code:
profiles/arch/amd64/use.mask-# Cuda works here
profiles/arch/amd64/use.mask:-cuda

profiles/arch/base/use.mask:# cuda only works on amd64/x86
profiles/arch/base/use.mask:cuda
Since you are on amd64, the former ought to override the latter, and allow you to use it. Additionally, the entries I found are quite old, and your post specifically says the flag "has become hard blocked" as if this were a very recent change. When did this last work for you? I made an additional attempt today, and found the below, which seemed plausible at first, but does not fit either:
Code:
profiles/arch/amd64/use.stable.mask-# Michał Górny <mgorny@gentoo.org> (2017-05-20)
profiles/arch/amd64/use.stable.mask-# The modern versions of CUDA SDK are not suitable for stabilization.
profiles/arch/amd64/use.stable.mask:cuda
Due to how Portage handles use.stable.mask, if you had previously installed an unstable Blender, then use.stable.mask would have been ignored at that time. I see from your emerge --info that you run stable normally. Did you at one time install an unstable Blender, and recently switch back to stable Blender? That does not track with blender-3.0.0 being ~amd64 currently and you having it already installed, but is the closest to an explanation I can see. When I try to install Blender here, I see cuda unmasked:
Code:
# ACCEPT_KEYWORDS=~amd64 emerge -pvO blender

These are the packages that would be merged, in order:

[ebuild  N     ] media-gfx/blender-3.0.0:3.0::gentoo  USE="bullet color-management cycles dds embree ffmpeg fftw fluid gmp oidn openexr openimageio openmp opensubdiv openvdb osl pdf potrace pugixml sndfile system-numpy system-python tbb tiff -alembic -collada -cuda -debug -doc -headless -jack -jemalloc -jpeg2k -man -ndof -nls -openal -pulseaudio -sdl -standalone -test -valgrind" PYTHON_SINGLE_TARGET="python3_9" 39228 KiB
Back to top
View user's profile Send private message
russellD
n00b
n00b


Joined: 07 Oct 2014
Posts: 55
Location: 28.5797S,153.338 E

PostPosted: Wed Jan 19, 2022 10:54 am    Post subject: Reply with quote

Hi Hu,

Thank you for the detailed reply!

This is the first time I have installed Blender which started a few days ago where I found cuda wasn't available in the Blender preferences.
Then removed Blender, added cuda to media-gfx/blender in /etc/portage/package.use/custom.use and ended up with the above output.

I did see the contrary entries in the amd64/use.mask and base/use.mask for cuda and found this puzzling.
And decided, that this was too deep Gentoo foo for me, so I leave these alone.

Using the tipoff from fedeliallalinea, blender got installed with cuda.
Which was:
1) to add -cuda to blender in /etc/portage/profile/package.use.mask
Code:
$ cat package.use.mask                                                                                                         
media-gfx/blender       -cuda

2) leave untouched /etc/portage/profile/use.mask
3) add cuda to blender in /etc/portage/package.use
Code:
$ grep cuda /etc/portage/package.use/custom.use
49:media-gfx/blender                    cuda

4) had to add USE prior to emerge to get the cuda flag applied:
Code:
USE="$USE cuda" emerge -va blender"


I can only think that maybe the profiles got messed up.
Is there some way to reset the profile files with the default?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21489

PostPosted: Thu Jan 20, 2022 3:08 am    Post subject: Re: cuda is not available as its a hard blocked flag Reply with quote

russellD wrote:
This is the first time I have installed Blender which started a few days ago where I found cuda wasn't available in the Blender preferences.
In your first post, you wrote:
russellD wrote:
The cuda flag has become hard blocked and this prevents blender and ffmpeg from using the cuda cores in a nvidia card.
The use of has become hard blocked sounds to me like "This was working, and now it is not working." That confused me into trying to find how this ever worked for you. Your later post makes me think this is your first time examining this, and that USE=cuda has never worked for you on Blender.
russellD wrote:
Then removed Blender, added cuda to media-gfx/blender in /etc/portage/package.use/custom.use and ended up with the above output.
You don't need to uninstall a package before changing its flags. Portage can handle rebuilding with different options.
russellD wrote:
3) add cuda to blender in /etc/portage/package.use
Code:
$ grep cuda /etc/portage/package.use/custom.use
49:media-gfx/blender                    cuda
This looks wrong to me. What is this 49:? It looks like it could be a grep line number, but you didn't use -n to grep. If that 49: is actually in the file, then Portage will not recognize this as a line that changes the configuration of blender.
russellD wrote:
I can only think that maybe the profiles got messed up.
Is there some way to reset the profile files with the default?
Profiles are managed by the Gentoo maintainers, and automatically updated on sync, since they are stored under $PORTDIR.
Back to top
View user's profile Send private message
russellD
n00b
n00b


Joined: 07 Oct 2014
Posts: 55
Location: 28.5797S,153.338 E

PostPosted: Thu Jan 20, 2022 12:23 pm    Post subject: Reply with quote

My aplogies for the confusion.

the 49: in the grep output is indeed a line number as grep is called from an alias:
Code:
alias grep='grep -n --color=auto'


thanks for he pointers!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21489

PostPosted: Thu Jan 20, 2022 3:59 pm    Post subject: Reply with quote

Since that 49: was added by grep, and is not in the file, the line you showed should have worked. You should not need to set $USE to anything. Please check that USE= emerge --pretend --verbose media-gfx/blender reports that it would rebuild without USE=cuda. If it would, then we need to find why your package.use entry is not working. Check that there are no other package.use entries elsewhere that would reverse it. Check that Portage can read the file. Try using that same line in custom.use to set some other blender flag, then check whether Portage would try to enable that flag on a rebuild.
Back to top
View user's profile Send private message
russellD
n00b
n00b


Joined: 07 Oct 2014
Posts: 55
Location: 28.5797S,153.338 E

PostPosted: Sun Jan 23, 2022 12:06 am    Post subject: Reply with quote

Hi Hu,
Thanks for the followup.
Blender is now emerging with the cuda flag without extra USE=
Code:
# USE= emerge --pretend --verbose media-gfx/blender
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild   R    ] media-gfx/blender-3.0.0:3.0::gentoo  USE="bullet color-management cuda cycles dds embree ffmpeg fftw fluid gmp jpeg2k nls oidn openal openexr openimageio openmp opensubdiv openvdb pdf potrace pugixml pulseaudio sdl sndfile system-numpy system-python tbb tiff -alembic -collada -debug -doc -headless -jack -jemalloc -man -ndof -osl -standalone -test -valgrind" PYTHON_SINGLE_TARGET="python3_9" 0 KiB

thank you for your help!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum