Unable to build dkms package for nvidia driver

Bug #1930452 reported by fluffy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-460-server (Ubuntu)
New
Undecided
Unassigned

Bug Description

There seems to be a mismatch between the compiler I have installed and the compiler that the build script is expecting; my build log is full of:

make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/nv-mmap.o] Error 1
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/nv-i2c.o] Error 1
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/nv-p2p.o] Error 1
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/nv-pat.o] Error 1
error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/nv-procfs.o] Error 1
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/nv-vm.o] Error 1
error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/nv-usermap.o] Error 1
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/nv-vtophys.o] Error 1
error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/os-interface.o] Error 1
make[2]: *** [scripts/Makefile.build:286: /var/lib/dkms/nvidia-srv/460.73.01/build/nvidia/os-mlock.o] Error 1

It looks like the problem may be that I have both clang and gcc installed:

jshagam@feldspar:~$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

jshagam@feldspar:~$ cc --version
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

The nvidia-dkms Makefile should probably be fixed to use gcc instead of cc, since these appear to be gcc-specific compiler flags.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: nvidia-dkms-460-server 460.73.01-0ubuntu0.20.04.1
ProcVersionSignature: Ubuntu 5.8.0-50.56~20.04.1-generic 5.8.18
Uname: Linux 5.8.0-50-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.18
Architecture: amd64
CasperMD5CheckResult: skip
Date: Tue Jun 1 10:40:04 2021
InstallationDate: Installed on 2021-03-25 (67 days ago)
InstallationMedia: Kubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nvidia-graphics-drivers-460-server
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
fluffy (fluffy) wrote :
Revision history for this message
fluffy (fluffy) wrote :

As a workaround, I was able to use update-alternatives to redirect cc to gcc, and then redirect it back to clang after I was done.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.