Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] nvidia-drivers error on "argument unused"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Sinbiosis
n00b
n00b


Joined: 03 Oct 2022
Posts: 30

PostPosted: Sat Jun 17, 2023 10:06 pm    Post subject: [Solved] nvidia-drivers error on "argument unused" Reply with quote

Issue
Trying to upgrade x11-drivers/nvidia-drivers (to version 525.116.04-r2) results in
Code:
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]


Command:
Code:
sudo emerge -av1 x11-drivers/nvidia-drivers


Output:
Code:
clang-15clang-15: : error: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]

clang-15clang-15clang-15: : : error: error: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]


clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-acpi.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-dmabuf.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-cray.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-nano-timer.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-pci.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-dma.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-i2c.o] Error 1
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
clang-15: error: clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]

clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-mmap.o] Error 1
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-usermap.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-p2p.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-pat.o] Error 1
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-vtophys.o] Error 1
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/os-pci.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-vm.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/nv-procfs.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/os-mlock.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel/nvidia/os-interface.o] Error 1
make[1]: *** [Makefile:2025: /var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel] Error 2
make: *** [Makefile:82: modules] Error 2
 * ERROR: x11-drivers/nvidia-drivers-525.116.04-r2::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-525.116.04-r2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-525.116.04-r2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel'
 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work'

>>> Failed to emerge x11-drivers/nvidia-drivers-525.116.04-r2, Log file:

>>>  '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/temp/build.log'

 * Messages for package x11-drivers/nvidia-drivers-525.116.04-r2:

 * ERROR: x11-drivers/nvidia-drivers-525.116.04-r2::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-525.116.04-r2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-525.116.04-r2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work/kernel'
 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-525.116.04-r2/work'


Command:
Code:
emerge --info '=x11-drivers/nvidia-drivers-525.116.04-r2::gentoo'


Output:
Code:
Portage 3.0.45.3 (python 3.11.3-final-0, default/linux/amd64/17.1/desktop/systemd/merged-usr, gcc-12, glibc-2.36-r8, 6.2.0-nvidia x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.2.0-nvidia-x86_64-AMD_Ryzen_9_5900X_12-Core_Processor-with-glibc2.36
KiB Mem:    65747512 total,  27213016 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 16 Jun 2023 18:32:02 +0000
Head commit of repository gentoo: 6f81431afa891196232b26692bd51bde2f9727cd

sh bash 5.1_p16-r4
ld GNU ld (Gentoo 2.39 p6) 2.39.0
ccache version 4.7.4 [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r4::gentoo
dev-lang/perl:             5.36.0-r2::gentoo
dev-lang/python:           3.10.10_p2::gentoo, 3.11.3::gentoo
dev-lang/rust-bin:         1.69.0::gentoo
dev-util/ccache:           4.7.4::gentoo
dev-util/cmake:            3.26.3::gentoo
dev-util/meson:            1.1.1::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-apps/systemd:          253.3-r1::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r1::gentoo
sys-devel/gcc:             12.2.1_p20230428-r1::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo
    volatile: False

Installed sets: @circuit-design, @openwrt-prerequisites, @python-packages
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=native -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O3 -pipe -march=native -mtune=native"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
FCFLAGS="-O3 -pipe -march=native -mtune=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live 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="-O3 -pipe -march=native -mtune=native"
GENTOO_MIRRORS="https://gentoo.osuosl.org/ https://mirrors.rit.edu/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j18"
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"
SHELL="/bin/zsh"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cli crypt cups dbus device-mapper dri dts dvdr encode exif flac fortran gdbm gif gpg gpm gui iconv icu ipv6 jpeg kde lcms libnotify libtirpc lto mad mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp sound spell ssl startup-notification svg symlink systemd test-rust tiff truetype udev udisks unicode upower usb vorbis vulkan wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2021" 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 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" 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" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby30 ruby31" SANE_BACKENDS="hp" VIDEO_CARDS="nvidia nouveau" 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS


Command:
Code:
emerge -pqv '=x11-drivers/nvidia-drivers-525.116.04-r2::gentoo'


Output:
Code:
[ebuild     U ] x11-drivers/nvidia-drivers-525.116.04-r2 [525.105.17] USE="X modules%* static-libs strip%* tools -dist-kernel -kernel-open -modules-sign% -persistenced -wayland (-driver%*)" ABI_X86="(64) -32"


Additional Information
I'm not sure how to upload the build.log file if that is needed.

I note here that I've found bugs and forums that seem related:
nvidia-drivers-440.64 fail to buiild against kernel 5.6
[Solved] Problem with nvidia-drivers and gentoo-sources

But none of the commands given seemed to help.
In addition, those issues never ran into this
Code:
clang-15: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]


Last edited by Sinbiosis on Sun Jun 18, 2023 2:40 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22603

PostPosted: Sat Jun 17, 2023 10:37 pm    Post subject: Reply with quote

clang is well known for being picky. In my opinion, it is often excessively picky, and that seems to be the case here. The build system passed an argument clang did not think was needed, so you got a fatal warning from it. I do not see anything in the ebuild or the emerge --info that should have caused use of clang. Why is clang being used here? Did you build the kernel with clang? Generally, you need to use the same compiler for the kernel and for the modules.
Back to top
View user's profile Send private message
Sinbiosis
n00b
n00b


Joined: 03 Oct 2022
Posts: 30

PostPosted: Sat Jun 17, 2023 11:10 pm    Post subject: Reply with quote

I did use clang for building the kernel. That might be the issue. I'll try rebuilding the kernel without clang, though I'll miss the LTO.
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2849

PostPosted: Sun Jun 18, 2023 12:55 am    Post subject: Reply with quote

Hm, this seems broken with 525 branch, could've sworn it used to work?

nvidia-drivers-535.54.03 builds fine with clang though, fwiw it's also the next stable candidate that's due to replace 525.xx -- given nvidia with clang kernel is kind of experimental, using latest drivers rather than stable may make more sense

Edit: seems 525 issues is same as https://github.com/NVIDIA/open-gpu-kernel-modules/issues/506 albeit no idea when this started, maybe due to newer clang-15.0.x, guess nvidia already fixed it in newer branches but hasn't been backported (from a quick look, all they did is drop the -MD flag, guess I could backport it)
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2849

PostPosted: Sun Jun 18, 2023 1:54 am    Post subject: Reply with quote

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec717d8006b9
Back to top
View user's profile Send private message
Sinbiosis
n00b
n00b


Joined: 03 Oct 2022
Posts: 30

PostPosted: Sun Jun 18, 2023 2:40 am    Post subject: Reply with quote

lonen, thanks for pointing that out about 535. I'm on the stable branch instead of testing, so nice to know I'll be able to move back to clang soon.

As for the solution, switching my compiler for the kernel back to gcc, and NOT clang, did solve the issue. Thank you, Hu!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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