Skip to content

amdgpu-pro: 17.40 -> 21.30 - #151019

Merged
vcunat merged 2 commits into
NixOS:masterfrom
corngood:amdgpu-pro
Jan 9, 2022
Merged

vcunat merged 2 commits into
NixOS:masterfrom
corngood:amdgpu-pro

Conversation

@corngood

@corngood corngood commented Dec 16, 2021 •

Copy link
Copy Markdown
Contributor
Motivation for this change

Upgrade to latest amdgpu-pro package.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

  • kernel module
  • xorg drivers
  • opengl
    • 64
    • 32
  • vulkan
    • 64
    • 32
  • opencl
    • 64
    • 32
  • vdpau
    • 64
    • 32
  • rocm?
    • 64
    • 32
  • binaries
    • 64
    • 32
  • wayland?

@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Dec 16, 2021
@corngood

Copy link
Copy Markdown
Contributor Author

This seems to work with linux-5.10. There are still lots of broken/untested things and cleanup to do.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure this is the best way, but using $out for these seemed to pollute the system.

Comment thread pkgs/top-level/linux-kernels.nix Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gross, but it depends on libffi.so.7, and we don't seem to have that anywhere else. Maybe there's a better place for it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to patchelf it to use our libffi or are the ABIs too incompatible?

@ofborg ofborg Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 16, 2021
@corngood corngood changed the title wip: amdgpu-pro: 17.40 -> 21.30 amdgpu-pro: 17.40 -> 21.30 Dec 21, 2021
This got broken by 370d3af.  Previously
it was setting /run/opengl-driver/lib.  `driverLink` is missing the
/lib.
@ofborg ofborg Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 21, 2021
@corngood

Copy link
Copy Markdown
Contributor Author

This should be ready for review. OpenGL and vulkan work in 32 and 64-bit. There's a bunch of other stuff in the upstream package, but I'm not sure how useful any of it is, so I'd like to gather some feedback / test cases. In any case this should be better than what was in there.

@vcunat maybe?

@vcunat

vcunat commented Dec 21, 2021

Copy link
Copy Markdown
Member

If it's very unlikely to make something worse, I can't see why wait.

One of my GPUs should be compatible if I look right*, but it's rather inconvenient for me to reboot this particular machine.

* release notes: https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-21-30

@ofborg ofborg Bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Dec 21, 2021

@Atemu Atemu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested it but I have some comment on the code.

Comment thread pkgs/top-level/linux-kernels.nix Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to patchelf it to use our libffi or are the ABIs too incompatible?

Comment on lines +170 to +195
preFixup = (if stdenv.is64bit
# this could also be done with LIBGL_DRIVERS_PATH, but it would need to be
# set in the user session and for Xorg
then ''
expr1='s:/opt/amdgpu/lib/x86_64-linux-gnu/dri\0:/run/opengl-driver/lib/dri\0\0\0\0\0\0\0\0\0\0\0:g'
expr2='s:/usr/lib/x86_64-linux-gnu/dri[\0\:]:/run/opengl-driver/lib/dri\0\0\0\0:g'
perl -pi -e "$expr2" $out/lib/xorg/modules/extensions/libglx.so
''
else ''
expr1='s:/opt/amdgpu/lib/i386-linux-gnu/dri\0:/run/opengl-driver-32/lib/dri\0\0\0\0\0\0:g'
# we replace a different path on 32-bit because it's the only one long
# enough to fit the target path :(
expr2='s:/usr/lib/i386-linux-gnu/dri[\0\:]:/run/opengl-driver-32/dri\0\0\0:g'
'') + ''
perl -pi -e "$expr1" \
$out/opt/amdgpu/lib/libEGL.so.1.0.0 \
$out/opt/amdgpu/lib/libgbm.so.1.0.0 \
$out/opt/amdgpu/lib/libGL.so.1.2.0

perl -pi -e "$expr2" \
$out/opt/amdgpu-pro/lib/libEGL.so.1 \
$out/opt/amdgpu-pro/lib/libGL.so.1.2 \
$out/opt/amdgpu-pro/lib/libGLX_amd.so.0

find $out -type f -exec perl -pi -e 's:/opt/amdgpu-pro/:/run/amdgpu-pro/:g' {} \;
find $out -type f -exec perl -pi -e 's:/opt/amdgpu/:/run/amdgpu/:g' {} \;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is string substitution with perl really a good solution here?

It was like this before, so I wouldn't see it as blocking but surely there must be a better solution.

, xorg, patchelf, openssl, libdrm, udev
, libxcb, libxshmfence, libepoxy, perl, zlib
, ncurses
, libsOnly ? false, kernel ? null

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not possible to use just the libs anymore? Using just the AMF libs for HW accelerated video encoding with an otherwise fully AMDGPU (non-pro) system would be a use-case here for example.

curlOpts = "--referer http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%e2%80%93Release-Notes.aspx";
url = "https://drivers.amd.com/drivers/linux/amdgpu-pro-${build}-ubuntu-20.04.tar.xz";
sha256 = "sha256-WECqxjo2WLP3kMWeVyJgYufkvHTzwGaj57yeMGXiQ4I=";
curlOpts = "--referer https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-21-30";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IME just support.amd.com also works.


boot.blacklistedKernelModules = [ "radeon" ];
boot.kernelPackages = pkgs.linuxKernel.packagesFor
(pkgs.linuxKernel.kernels.linux_5_10.override {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 5.10 the only compatible kernel? If so, please make meta.broken a reflection of that fact.

@vcunat vcunat linked an issue Dec 26, 2021 that may be closed by this pull request
@lambdadog lambdadog mentioned this pull request Dec 26, 2021
5 of 16 tasks
@davidak

davidak commented Dec 27, 2021 •

Copy link
Copy Markdown
Member

This does not work for me with pantheon desktop. The session always crashes when i try to login. RX 480

Dec 27 02:20:05 gaming systemd[1]: Started X11 Server.
Dec 27 02:20:05 gaming systemd[1]: display-manager.service: Main process exited, code=exited, status=1/FAILURE
Dec 27 02:20:05 gaming systemd[1]: display-manager.service: Failed with result 'exit-code'.
Dec 27 02:20:06 gaming systemd[1]: display-manager.service: Scheduled restart job, restart counter is at 1.
Dec 27 02:20:06 gaming systemd[1]: Stopped X11 Server.
Dec 27 02:20:06 gaming kernel: [drm] amdgpu kernel modesetting enabled.
Dec 27 02:20:06 gaming kernel: [drm] amdgpu version: 5.11.19.21.30
Dec 27 02:20:06 gaming kernel: [drm] OS DRM version: 5.10.0
Dec 27 02:20:06 gaming kernel: amdgpu: CRAT table not found
Dec 27 02:20:06 gaming kernel: amdgpu: Virtual CRAT table created for CPU
Dec 27 02:20:06 gaming kernel: amdgpu: Topology: Add CPU node
Dec 27 02:20:06 gaming systemd[1]: Starting X11 Server...
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: vgaarb: deactivate vga console
Dec 27 02:20:06 gaming kernel: Console: switching to colour dummy device 80x25
Dec 27 02:20:06 gaming kernel: [drm] initializing kernel modesetting (POLARIS10 0x1002:0x67DF 0x174B:0xE347 0xC7).
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: amdgpu: Trusted Memory Zone (TMZ) feature not supported
Dec 27 02:20:06 gaming kernel: [drm] register mmio base: 0x50200000
Dec 27 02:20:06 gaming kernel: [drm] register mmio size: 262144
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 0 <vi_common>
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 1 <gmc_v8_0>
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 2 <tonga_ih>
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 3 <gfx_v8_0>
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 4 <sdma_v3_0>
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 5 <powerplay>
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 6 <dm>
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 7 <uvd_v6_0>
Dec 27 02:20:06 gaming kernel: [drm] add ip block number 8 <vce_v3_0>
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: No more image in the PCI ROM
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: amdgpu: Fetched VBIOS from ROM BAR
Dec 27 02:20:06 gaming kernel: amdgpu: ATOM BIOS: 113-2E3470U.O5Y
Dec 27 02:20:06 gaming kernel: [drm] UVD is enabled in VM mode
Dec 27 02:20:06 gaming kernel: [drm] UVD ENC is enabled in VM mode
Dec 27 02:20:06 gaming kernel: [drm] VCE enabled in VM mode
Dec 27 02:20:06 gaming kernel: [drm] vm size is 128 GB, 2 levels, block size is 10-bit, fragment size is 9-bit
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: amdgpu: VRAM: 8192M 0x000000F400000000 - 0x000000F5FFFFFFFF (8192M used)
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: amdgpu: GART: 256M 0x000000FF00000000 - 0x000000FF0FFFFFFF
Dec 27 02:20:06 gaming kernel: [drm] Detected VRAM RAM=8192M, BAR=256M
Dec 27 02:20:06 gaming kernel: [drm] RAM width 256bits GDDR5
Dec 27 02:20:06 gaming kernel: [drm] amdgpu: 8192M of VRAM memory ready
Dec 27 02:20:06 gaming kernel: [drm] amdgpu: 32047M of GTT memory ready.
Dec 27 02:20:06 gaming kernel: [drm] GART: num cpu pages 65536, num gpu pages 65536
Dec 27 02:20:06 gaming kernel: [drm] PCIE GART of 256M enabled (table at 0x000000F400900000).
Dec 27 02:20:06 gaming kernel: [drm] Chained IB support enabled!
Dec 27 02:20:06 gaming kernel: amdgpu: [powerplay] hwmgr_sw_init smu backed is polaris10_smu
Dec 27 02:20:06 gaming kernel: [drm] Found UVD firmware Version: 1.130 Family ID: 16
Dec 27 02:20:06 gaming kernel: [drm] Found VCE firmware Version: 53.26 Binary ID: 3
Dec 27 02:20:06 gaming kernel: [drm] Display Core initialized with v3.2.140!
Dec 27 02:20:06 gaming kernel: snd_hda_intel 0000:01:00.1: bound 0000:01:00.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])
Dec 27 02:20:06 gaming systemd[1]: Started X11 Server.
Dec 27 02:20:06 gaming kernel: thermal LNXTHERM:00: registered as thermal_zone2
Dec 27 02:20:06 gaming kernel: ACPI: Thermal Zone [TZ10] (17 C)
Dec 27 02:20:06 gaming kernel: thermal LNXTHERM:01: registered as thermal_zone3
Dec 27 02:20:06 gaming kernel: ACPI: Thermal Zone [TZ00] (28 C)
Dec 27 02:20:06 gaming kernel: [drm] UVD and UVD ENC initialized successfully.
Dec 27 02:20:06 gaming systemd[1]: display-manager.service: Main process exited, code=exited, status=1/FAILURE
Dec 27 02:20:06 gaming systemd[1]: display-manager.service: Failed with result 'exit-code'.
Dec 27 02:20:06 gaming kernel: [drm] VCE initialized successfully.
Dec 27 02:20:06 gaming kernel: kfd kfd: amdgpu: Allocated 3969056 bytes on gart
Dec 27 02:20:06 gaming kernel: amdgpu: SRAT table not found
Dec 27 02:20:06 gaming kernel: amdgpu: Virtual CRAT table created for GPU
Dec 27 02:20:06 gaming kernel: amdgpu: Topology: Add dGPU node [0x67df:0x1002]
Dec 27 02:20:06 gaming kernel: kfd kfd: amdgpu: added device 1002:67df
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: amdgpu: SE 4, SH per SE 1, CU per SH 9, active_cu_number 36
Dec 27 02:20:06 gaming kernel: [drm] fb mappable at 0x40E30000
Dec 27 02:20:06 gaming kernel: [drm] vram apper at 0x40000000
Dec 27 02:20:06 gaming kernel: [drm] size 14745600
Dec 27 02:20:06 gaming kernel: [drm] fb depth is 24
Dec 27 02:20:06 gaming kernel: [drm]    pitch is 10240
Dec 27 02:20:06 gaming kernel: fbcon: amdgpudrmfb (fb0) is primary device
Dec 27 02:20:06 gaming kernel: Console: switching to colour frame buffer device 180x56
Dec 27 02:20:06 gaming systemd[1]: display-manager.service: Scheduled restart job, restart counter is at 2.
Dec 27 02:20:06 gaming systemd[1]: Stopped X11 Server.
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: [drm] fb0: amdgpudrmfb frame buffer device
Dec 27 02:20:06 gaming systemd[1]: Starting X11 Server...
Dec 27 02:20:06 gaming kernel: amdgpu 0000:01:00.0: amdgpu: Using BACO for runtime pm
Dec 27 02:20:06 gaming kernel: [drm] Initialized amdgpu 3.42.0 20150101 for 0000:01:00.0 on minor 0
Dec 27 02:20:07 gaming systemd[1]: Started X11 Server.
...
Dec 27 02:20:44 gaming xsession[1965]: gnome-session-is-accelerated: No hardware 3D support.
Dec 27 02:20:44 gaming xsession[1955]: gnome-session-check-accelerated: GL Helper exited with code 256
Dec 27 02:20:44 gaming xsession[1966]: amdgpu_device_initialize: amdgpu_get_auth (1) failed (-1)
Dec 27 02:20:44 gaming xsession[1966]: amdgpu_device_initialize: amdgpu_get_auth (1) failed (-1)
Dec 27 02:20:44 gaming gnome-session-c[1966]: eglInitialize() failed
Dec 27 02:20:44 gaming xsession[1955]: gnome-session-check-accelerated: GLES Helper exited with code 256
Dec 27 02:20:44 gaming xsession[1943]: gnome-session-binary[1943]: DEBUG(+): hardware acceleration check failed: Child process exited with code 1
Dec 27 02:20:44 gaming gnome-session-binary[1943]: DEBUG(+): hardware acceleration check failed: Child process exited with code 1

@corngood

Copy link
Copy Markdown
Contributor Author

@davidak could you share the output of your Xorg log? e.g. /var/log/X.0.log

Thanks

@turboMaCk

turboMaCk commented Jan 3, 2022 •

Copy link
Copy Markdown
Member

I can confirm this works with my setup! I'm using xorg + xmonad.

[AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] (rev c1)

@vcunat

vcunat commented Jan 9, 2022

Copy link
Copy Markdown
Member

This PR still sounds like improving the situation, so let's merge already. Feel free to improve in further PRs.

"https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-${build}.tar.xz";
sha256 = "1c073lp9cq1rc2mddky2r0j2dv9dd167qj02visz37vwaxbm2r5h";
curlOpts = "--referer http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%e2%80%93Release-Notes.aspx";
url = "https://drivers.amd.com/drivers/linux/amdgpu-pro-${build}-ubuntu-20.04.tar.xz";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you find that link?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if such a file is still available. they have some installer here https://www.amd.com/de/support/linux-drivers

@SuperSandro2000 SuperSandro2000 Sep 5, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

amdgpu-pro no longer works on unstable

6 participants