Skip to content

geekbench5 don't find compute devices #87990

Closed

Description

@davidak

Describe the bug

nix run --arg config '{ allowUnfree = true; }' nixpkgs.geekbench -c geekbench5 --compute-list

don't list compute devices

Expected behavior
I have a Radeon RX 480 and use PR #82729 to have OpenCL support in Mesa. BOINC and clinfo detects the GPU as OpenCL device.

[davidak@gaming:~]$ nix run nixpkgs.clinfo -c clinfo
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 19.3.3
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     AMD Radeon (TM) RX 480 Graphics (POLARIS10, DRM 3.35.0, 5.4.41, LLVM 9.0.1)
...

And even Vulkan seems to work:

[davidak@gaming:~]$ nix run nixpkgs.vulkan-tools -c vulkaninfo
==========
VULKANINFO
==========

Vulkan Instance Version: 1.2.131


Instance Extensions: count = 18
====================
	VK_EXT_acquire_xlib_display            : extension revision 1
	VK_EXT_debug_report                    : extension revision 9
...

Same with Nvidia:

[davidak@gaming:~]$ nix run nixpkgs.clinfo -c clinfo
Number of platforms                               1
  Platform Name                                   NVIDIA CUDA
  Platform Vendor                                 NVIDIA Corporation
  Platform Version                                OpenCL 1.2 CUDA 10.2.159
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics
  Platform Extensions function suffix             NV

  Platform Name                                   NVIDIA CUDA
Number of devices                                 2
  Device Name                                     GeForce GTX 1050 Ti
  Device Vendor                                   NVIDIA Corporation
  Device Vendor ID                                0x10de
  Device Version                                  OpenCL 1.2 CUDA
  Driver Version                                  440.82
[davidak@gaming:~]$ nix run nixpkgs.vulkan-tools -c vulkaninfo 
==========
VULKANINFO
==========

Vulkan Instance Version: 1.2.131


Instance Extensions: count = 17
====================
	VK_EXT_acquire_xlib_display            : extension revision 1
	VK_EXT_debug_report                    : extension revision 9

Notify maintainers
@michalrus

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.4.41, NixOS, 20.03.1879.91cdcf31357 (Markhor)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.4
  • channels(root): "nixos-20.03.1879.91cdcf31357, nixos-hardware, nixos-unstable-20.09pre225931.32b8ed73809"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
    Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute: geekbench
# a list of nixos modules affected by the problem
module:

Activity

  1. added
    0.kind: bug
    on May 16, 2020
  2. davidak commented on May 17, 2020

    @davidak
    MemberAuthor

    My next step would be to add ocl-icd as dependency and to the PATH. It works in BOINC.

  3. added
    6.topic: hardware
    on May 18, 2020
  4. davidak commented on May 28, 2020

    @davidak
    MemberAuthor

    That would be too easy... further debugging.

    strace -f geekbench5 --compute-list
    ...
    [pid  2053] openat(AT_FDCWD, "/nix/store/244yvw8fnxdv6zfkq2c6jqmw35jg6ib7-gcc-9.3.0-lib/lib/libcuda.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libcuda.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/244yvw8fnxdv6zfkq2c6jqmw35jg6ib7-gcc-9.3.0-lib/lib/libOpenCL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libOpenCL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/244yvw8fnxdv6zfkq2c6jqmw35jg6ib7-gcc-9.3.0-lib/lib/libOpenCL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libOpenCL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/244yvw8fnxdv6zfkq2c6jqmw35jg6ib7-gcc-9.3.0-lib/lib/libvulkan.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libvulkan.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/244yvw8fnxdv6zfkq2c6jqmw35jg6ib7-gcc-9.3.0-lib/lib/libvulkan.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [pid  2053] openat(AT_FDCWD, "/nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libvulkan.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    

    So we need libcuda.so, libOpenCL.so, libOpenCL.so.1, libvulkan.so and vulkan.so.1 in the PATH.

    I figured it out!

    lrwxrwxrwx 1 nixbld nixbld   75 May 28 19:07 libOpenCL.so -> /nix/store/lhkz2r1q657qf12xaad7bwr1nfa75i7r-ocl-icd-2.2.10/lib/libOpenCL.so
    lrwxrwxrwx 1 nixbld nixbld   77 May 28 19:07 libOpenCL.so.1 -> /nix/store/lhkz2r1q657qf12xaad7bwr1nfa75i7r-ocl-icd-2.2.10/lib/libOpenCL.so.1
    lrwxrwxrwx 1 nixbld nixbld   83 May 28 19:07 libcuda.so -> /nix/store/pcf2yakgq3wj1y6dblp2sn4wzrrbgv0l-nvidia-x11-440.82-5.4.43/lib/libcuda.so
    lrwxrwxrwx 1 nixbld nixbld   84 May 28 19:07 libvulkan.so -> /nix/store/6lb7zpf1hlg556j2rr7rrhm9iv5smsc0-vulkan-loader-1.2.131.2/lib/libvulkan.so
    lrwxrwxrwx 1 nixbld nixbld   86 May 28 19:07 libvulkan.so.1 -> /nix/store/6lb7zpf1hlg556j2rr7rrhm9iv5smsc0-vulkan-loader-1.2.131.2/lib/libvulkan.so.1
    
    [davidak@gaming:~/code/nixpkgs]$ geekbench5 --compute-list
    ...
    OpenCL
    0 0 AMD Radeon (TM) RX 480 Graphics (POLARIS10, DRM 3.36.0, 5.6.13, LLVM 9.0.1)
    Vulkan
    0 0 AMD RADV POLARIS10 (LLVM 9.0.1)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: hardware

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions