Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ati_unfree: don't build with kernel 4.14 #36802

Closed
davidak opened this issue Mar 11, 2018 · 17 comments
Closed

ati_unfree: don't build with kernel 4.14 #36802

davidak opened this issue Mar 11, 2018 · 17 comments

Comments

@davidak
Copy link
Member

davidak commented Mar 11, 2018

Issue description

Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel.

Reproducible with kernel 4.14 and 4.15.

It builds with 4.4 and 4.9, but display-manager fails to start. That's probably due to my old crappy GPU.

[   21.022461] <3>[fglrx:firegl_init_device_list] *ERROR* No supported display adapters were found
[   21.022463] <3>[fglrx:firegl_init_module] *ERROR* firegl_init_devices failed

rebuild:

make[1]: Entering directory '/nix/store/l6y1zslmx3637ylm3pw1shwhpizlgc4h-linux-4.14.24-dev/lib/modules/4.14.24/build'
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc option to accept ISO C99... none needed
checking whether __clang__ is declared... no
checking whether __INTEL_COMPILER is declared... no
checking whether __SUNPRO_C is declared... no
checking for pkg-config... /nix/store/340wmknqs4by554nwpg3hcr52lshqdj2-pkg-config-0.29.2/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /nix/store/navldm477k3ar6cy0zlw9rk43i459g69-gnused-4.4/bin/sed
checking if gcc supports -Werror=unknown-warning-option... no
checking if gcc supports -Werror=unused-command-line-argument... no
checking if gcc supports -Wall... yes
checking if gcc supports -Wpointer-arith... yes
checking if gcc supports -Wmissing-declarations... yes
checking if gcc supports -Wformat=2... yes
/nix/store/l6y1zslmx3637ylm3pw1shwhpizlgc4h-linux-4.14.24-dev/lib/modules/4.14.24/source/Makefile:943: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.
make[2]: *** [Makefile:146: sub-make] Error 2
make[1]: *** [Makefile:24: __sub-make] Error 2
make[1]: Leaving directory '/nix/store/l6y1zslmx3637ylm3pw1shwhpizlgc4h-linux-4.14.24-dev/lib/modules/4.14.24/build'
make: *** [Makefile:88: kmod_build] Error 2
+ exitHandler
+ exitCode=2
+ set +e
+ '[' -n '' ']'
+ ((  2 != 0  ))
+ runHook failureHook
++ shopt -po nounset
+ local 'oldOpts=set +o nounset'
+ set -u
+ local hookName=failureHook
+ shift
+ local 'hooksSlice=failureHooks[@]'
+ local hook
+ for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}
+ _eval '_callImplicitHook 0 failureHook'
++ type -t '_callImplicitHook 0 failureHook'
+ '[' '' = function ']'
+ set +u
+ eval '_callImplicitHook 0 failureHook'
++ _callImplicitHook 0 failureHook
++ set -u
++ local def=0
++ local hookName=failureHook
++ case "$(type -t "$hookName")" in
+++ type -t failureHook
++ '[' -z '' ']'
++ return 0
+ set -u
+ eval 'set +o nounset'
++ set +o nounset
+ return 0
+ '[' -n '' ']'
+ exit 2
builder for '/nix/store/s29c7zz6nbcxb5b6q42ilb4xfmll24vv-ati-drivers-15.12-4.14.24.drv' failed with exit code 2
cannot build derivation '/nix/store/xm4m3psy15kqwav0w8wcl08kgbnxy0jb-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3p8zad1fj69rips26bsc1akn5s8vbljq-kernel-modules.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/yl7qzmylzlcibyakjxs4ip6jw42xjdi5-opengl-drivers.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/yq6kz0230yl74hms4mm4j4gg3xlbn29j-system-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/dd1qa0ykskxkjp359xpr6sys8j5czm9x-nixos-system-dc7800-18.03pre130932.cc4677c36ee.drv': 1 dependencies couldn't be built
error: build of '/nix/store/dd1qa0ykskxkjp359xpr6sys8j5czm9x-nixos-system-dc7800-18.03pre130932.cc4677c36ee.drv' failed

Steps to reproduce

  services.xserver.videoDrivers = [ "ati_unfree" ];
  nixpkgs.config.allowUnfree = true;

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.24, NixOS, 18.03pre130932.cc4677c36ee (Impala)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.0
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@ghost
Copy link

ghost commented Apr 9, 2018

Also seeing this as of nixos-18.03.131807.489a14add9a. Is there a workaround?
It seems something like this was fixed, so this could be a regression: #33166

@mrkkrp
Copy link
Member

mrkkrp commented Jun 9, 2018

I've run into this today as well :(

@et4te
Copy link
Contributor

et4te commented Jun 15, 2018

I ran into this problem with 4.17.1 as well whilst trying to upgrade the amdgpu-pro drivers.

@et4te
Copy link
Contributor

et4te commented Jun 15, 2018

FYI the workaround I used to get it to start building (still failing but for other reasons) was to add,

    nativeBuildInputs = kernel.moduleBuildDependencies;

Within default.nix, stdenv.mkDerivation { ... } of the relevant package.

@davidak
Copy link
Member Author

davidak commented Nov 4, 2018

Problem still reproducible with 18.09.git.06fb025 (Jellyfish).

@peterwilli
Copy link
Contributor

Same problem here with amdgpu-pro

@daveman1010221
Copy link

Is there a way I can manually provide the radeon-crimson-15.12-15.302-151217a-297685e.zip file I just downloaded? nixos-rebuild switch still fails with the error listed above. This particular system will not boot into X without the proprietary ATI drivers. Thanks.

@daveman1010221
Copy link

I was mistaken, the driver did not download. wget retrieves an html file and named it .zip. :-/ Is there a path forward on this, somewhere I can get the right drivers and get them installed on NixOS?

@daveman1010221
Copy link

Updated to “unstable”, found the file download. Now compilation fails: error: ‘struct vm_fault’ has no member named ‘virtual address’.

@Likivik
Copy link

Likivik commented Jan 16, 2020

Anyone found any solutions or workarounds for ati_unfree, or is it time to upgrade a gpu? I get build errors (will add soon) on 19.09 "Loris" with kernels 4.4, 4.14 and 4.19.

@jerith666
Copy link
Contributor

As it happens, I did plow through getting this to build with 4.19 a month or two ago ... and then ordered a new GPU anyway a few weeks later, so never got around to making a PR! :-/

The raw commits are here if you want to take a look: jerith666/nixpkgs@ed2a4a8...e2f91a8

I'd be more than happy if you wanted to rebase, cleanup, and make a PR out of them!

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/working-amdgpu-configurations/2305/12

@davidak
Copy link
Member Author

davidak commented May 10, 2020

The problem is still reproducible with 20.03 and Kernel 4.4.x, 4.9.x, 4.14.x, 5.4.39 and 5.6.11.

The next steps here would be to check out the patches in #36802 (comment) and create a PR from it. (i currently work on other things)

@davidak
Copy link
Member Author

davidak commented May 12, 2020

The driver builds when i naively rebuild from the fork. It get login screen (lightdm), but when i login, i have a black screen with a cursor and many errors in syslog. That might be related to Pantheon desktop at that state.

nixos-rebuild switch -I nixpkgs=https://api.github.com/repos/jerith666/nixpkgs/tarball/efdb660083047d7016e8fd3c1f14e09440d362c

With MATE desktop, it works! I can open the ATI settings.

I tried to cherry-pick the changes onto master, but the build fails. Probably more patches are needed now for latest X11 etc.

Here is the latest state: https://github.com/davidak/nixpkgs/tree/ati_unfree

...
make[1]: Leaving directory '/build/xorg-server-1.17.4/exa'
Making all in glamor
make[1]: Entering directory '/build/xorg-server-1.17.4/glamor'
  CC       glamor.lo
In file included from /nix/store/2w4kby6pnscgdsbay9xzb2nrifcjml1r-libglvnd-1.3.1-dev/include/EGL/eglplatform.h:128,
                 from /nix/store/8gfmj7xbxbl7wbcqfhkxla35hsnhi02h-epoxy-1.5.4-dev/include/epoxy/egl_generated.h:11,
                 from /nix/store/8gfmj7xbxbl7wbcqfhkxla35hsnhi02h-epoxy-1.5.4-dev/include/epoxy/egl.h:46,
                 from glamor_priv.h:43,
                 from glamor.c:36:
/nix/store/6w463c8dh0qzf5l2lz42k683nl46bkp9-libX11-1.6.8-dev/include/X11/Xlib.h:222:2: error: conflicting types for 'GC'
  222 | *GC;
      |  ^~
In file included from glamor.h:34,
                 from glamor_priv.h:32,
                 from glamor.c:36:
../include/gcstruct.h:289:3: note: previous declaration of 'GC' was here
  289 | } GC;
      |   ^~
make[1]: *** [Makefile:736: glamor.lo] Error 1
make[1]: Leaving directory '/build/xorg-server-1.17.4/glamor'
make: *** [Makefile:771: all-recursive] Error 1
builder for '/nix/store/w98ng0bns48cwgd89g2ycmrgc6ki3534-xorg-server-1.17.4.drv' failed with exit code 2
cannot build derivation '/nix/store/vs3h4aic2114bcs89afxgl1xfspp0wq9-system-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/yfr2skhqhav6f8z0qygirhyrsmgs9jsq-xf86-input-evdev-2.10.6.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/27257hhsh7fi79n51ciajgcvdq502915-xserver-wrapper.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/d930xfpiz41d34f0b342pp6myq56sxpk-xsession-wrapper.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/0r48ksc29i4zqx8sgz4ws9hma194cj7d-nixos-system-imac-20.09.git.58ec917cfddM.drv': 1 dependencies couldn't be built
error: build of '/nix/store/0r48ksc29i4zqx8sgz4ws9hma194cj7d-nixos-system-imac-20.09.git.58ec917cfddM.drv' failed
  hardware.cpu.intel.updateMicrocode = true;
  # use latest kernel to have best performance
  #boot.kernelPackages = pkgs.linuxPackages_latest;
  # try older kernel for ati driver to work
  boot.kernelPackages = pkgs.linuxPackages_4_19;
  # build fails with any kernel https://github.com/NixOS/nixpkgs/issues/36802
  services.xserver.videoDrivers = [ "ati_unfree" ];
  nixpkgs.config.allowUnfree = true;

  # build fails
  services.xserver.useGlamor = lib.mkForce false;
  services.xserver.desktopManager.pantheon.enable = lib.mkForce false;
  #services.xserver.desktopManager.gnome3.enable = true;
  #services.xserver.desktopManager.gnome3.debug = true;
  #services.xserver.desktopManager.gnome3.flashback.enableMetacity = true;

  services.xserver.desktopManager.mate.enable = true;
  services.xserver.desktopManager.mate.debug = true;

@jerith666
Copy link
Contributor

you could probably use https://github.com/timokau/nix-bisect to determine whether it was a kernel update or something else that caused that breakage. my guess is you'll probably find a few new patches in arch or another upstream that just need to be pulled down and added to nixpkgs.

@stale
Copy link

stale bot commented Nov 8, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 8, 2020
@yvesf
Copy link
Member

yvesf commented May 21, 2021

I think this is fixed/obsolete by 7117588

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 21, 2021
@davidak davidak closed this as completed May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants