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

Mesa 22.3.1 #204125

Merged
merged 3 commits into from
Dec 24, 2022
Merged

Mesa 22.3.1 #204125

merged 3 commits into from
Dec 24, 2022

Conversation

K900
Copy link
Contributor

@K900 K900 commented Dec 2, 2022

Description of changes

Disgusting LLVM hacks inside. Probably breaks other libclc stuff. Barely tested. Have fun.

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/)
  • 23.05 Release Notes (or backporting 22.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.

Comment on lines 85 to 97
diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build
index a968dee52db..ebda0045ea8 100644
--- a/src/gallium/targets/rusticl/meson.build
+++ b/src/gallium/targets/rusticl/meson.build
@@ -59,7 +59,7 @@ configure_file(
input : 'rusticl.icd.in',
output : 'rusticl.icd',
install : true,
- install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
+ install_dir : join_paths(get_option('prefix'), 'etc', 'OpenCL', 'vendors'),
)

if meson.version().version_compare('>= 0.58')
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should actually probably just not install those files, as we end up deleting them in postInstall anyway.

Comment on lines +47 to +51
rust-bindgen' = rust-bindgen.override {
rust-bindgen-unwrapped = rust-bindgen.unwrapped.override {
clang = llvmPackages.clang;
};
};
Copy link
Member

Choose a reason for hiding this comment

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

Can you please explain why this is necessary? Sorry, I don't understand it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default bindgen is wrapped with libclang 11 which is too old for building rusticl.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe the default rust-bindgen is worth bumping to newer clang? (in a different PR, preferably) Maintainers: @JohnTitor, @Ralith.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately the proper solution here is probably to version bindgen (if not rust), as different packages will want a different LLVM in the closure.

Copy link
Member

Choose a reason for hiding this comment

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

to make this a little less ugly I would suggest to add an easier way to overwrite clang for rust-bindgen.

Comment on lines 20194 to 20196
libclc = callPackage ../development/libraries/libclc { };
libclc = callPackage ../development/libraries/libclc {
llvmPackages = llvmPackages_latest;
};
Copy link
Member

@hmenke hmenke Dec 2, 2022

Choose a reason for hiding this comment

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

I just built libclc successfully against the regular llvmPackages on NixOS 22.11. The override with llvmPackages_latest doesn't seem to be necessary.

Derivation
{
  "/nix/store/l4ccy0bjw1h8i8j32w4xrxrbijxy109r-libclc-14.0.6.drv": {
    "outputs": {
      "out": {
        "path": "/nix/store/sws900kbpmmjwpfsfdp3kn9x7mgpmw1c-libclc-14.0.6"
      }
    },
    "inputSrcs": [
      "/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh"
    ],
    "inputDrvs": {
      "/nix/store/05n8dblmwlkafylbai3hhx4nz88g2vbz-clang-11.1.0.drv": [
        "dev",
        "out"
      ],
      "/nix/store/11dz31m8rb8lmh9r9jy6imph8wbqmsv3-cmake-3.24.3.drv": [
        "out"
      ],
      "/nix/store/1kbciw3fk38lvwv5kmc4zgz0f6dqldx8-source.drv": [
        "out"
      ],
      "/nix/store/2knhp55njxnhh7j1l0w7ns0hi6bxmn1k-stdenv-linux.drv": [
        "out"
      ],
      "/nix/store/3sjd4vvbdssljiy45a9igjy9kkxd2skq-bash-5.1-p16.drv": [
        "out"
      ],
      "/nix/store/8gka1ln4n7xi55hgkj8qdixydg7kwlcf-ninja-1.11.1.drv": [
        "out"
      ],
      "/nix/store/hgv33pjyznisg95ljrygyxk4xc7fbrp5-llvm-11.1.0.drv": [
        "dev"
      ],
      "/nix/store/kxfzn11kf6nh0igzsgfm72zfxj77lsda-python3-3.10.8.drv": [
        "out"
      ],
      "/nix/store/lrljsy25g5las83hhfxlqrjgch4dlm53-SPIRV-LLVM-Translator-unstable-2022-05-04.drv": [
        "out"
      ]
    },
    "system": "x86_64-linux",
    "builder": "/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin/bash",
    "args": [
      "-e",
      "/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh"
    ],
    "env": {
      "buildInputs": "/nix/store/kzf7caq6grrh0gjchwajv9v264vfwlr9-llvm-11.1.0-dev /nix/store/0ammdv24jk6iz35gd7psha0li6g6k5d4-clang-11.1.0-dev",
      "builder": "/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin/bash",
      "cmakeFlags": "-DCMAKE_INSTALL_INCLUDEDIR=include",
      "configureFlags": "",
      "depsBuildBuild": "",
      "depsBuildBuildPropagated": "",
      "depsBuildTarget": "",
      "depsBuildTargetPropagated": "",
      "depsHostHost": "",
      "depsHostHostPropagated": "",
      "depsTargetTarget": "",
      "depsTargetTargetPropagated": "",
      "doCheck": "",
      "doInstallCheck": "",
      "mesonFlags": "",
      "name": "libclc-14.0.6",
      "nativeBuildInputs": "/nix/store/rxb9zl1mdx9f2n3z0nyv9zhngj3f2pw0-cmake-3.24.3 /nix/store/lfj3vna0mcps3fcjlg5gw4jss05kvgry-ninja-1.11.1 /nix/store/zdba9frlxj2ba8ca095win3nphsiiqhb-python3-3.10.8 /nix/store/91i4dkyivd1i5jljyy2l14pbbyf8kwn1-SPIRV-LLVM-Translator-unstable-2022-05-04",
      "out": "/nix/store/sws900kbpmmjwpfsfdp3kn9x7mgpmw1c-libclc-14.0.6",
      "outputs": "out",
      "patches": "",
      "pname": "libclc",
      "postPatch": "substituteInPlace CMakeLists.txt \\\n  --replace 'find_program( LLVM_CLANG clang PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )' \\\n            'find_program( LLVM_CLANG clang PATHS \"/nix/store/6zka9igv5cif9k4h6zf37y9sjlnbq8n3-clang-11.1.0/bin\" NO_DEFAULT_PATH )' \\\n  --replace 'find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )' \\\n            'find_program( LLVM_SPIRV llvm-spirv PATHS \"/nix/store/91i4dkyivd1i5jljyy2l14pbbyf8kwn1-SPIRV-LLVM-Translator-unstable-2022-05-04/bin\" NO_DEFAULT_PATH )'\n",
      "propagatedBuildInputs": "",
      "propagatedNativeBuildInputs": "",
      "sourceRoot": "source/libclc",
      "src": "/nix/store/v4nsp8wi4p9iv73202k9kp0hbcj1lfcr-source",
      "stdenv": "/nix/store/kmfaajdpyyyg319vfqni5jm9wkxjmf73-stdenv-linux",
      "strictDeps": "1",
      "system": "x86_64-linux",
      "version": "14.0.6"
    }
  }
}

I've also push the path to my Cachix.

@K900 K900 force-pushed the mesa-22.3 branch 2 times, most recently from 7a45c69 to 27a8e37 Compare December 4, 2022 08:58
@hmenke
Copy link
Member

hmenke commented Dec 4, 2022

We probably also have to add this patch for an upstream regression: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20145

@K900 K900 marked this pull request as ready for review December 4, 2022 11:17
@K900 K900 marked this pull request as draft December 4, 2022 11:17
@K900
Copy link
Contributor Author

K900 commented Dec 4, 2022

We usually wait for a x.y.1 release for this reason.

@Atemu
Copy link
Member

Atemu commented Dec 5, 2022

Target should be staging.

@K900
Copy link
Contributor Author

K900 commented Dec 5, 2022

I'll retarget later, there are too many rebuilds on current staging to test this reasonably quickly.

@Atemu
Copy link
Member

Atemu commented Dec 5, 2022

Unless mesa was directly modified in staging in a way that would conflict, you don't need to rebase; you only need to change the target branch in the PR settings. Staging is master + some extra, you can merge master into that.

Anything that touches mesa will need to rebuild a ton of large packages. It's not as many as I had thought but still enough to warrant staging I think.

@SuperSandro2000
Copy link
Member

Yes, of course this will target staging later but for now not targeting it keeps the amounts of required rebuilds for local testing lower.

@LunNova
Copy link
Member

LunNova commented Dec 5, 2022

Intel Arc GPUs on this version need INTEL_DEBUG=no32 env var set or will hang https://gitlab.freedesktop.org/mesa/mesa/-/issues/7755#note_1673391

Copy link
Member

@PedroHLC PedroHLC left a comment

Choose a reason for hiding this comment

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

Have you tested rusticl with luxmark?

I rebased my overlay with yours' mesa + 22.3 branch. When I have /run/opengl-drivers/etc/OpenCL/vendors/rusticl.icd it crashes with:

mesa: CommandLine Error: Option 'limited-coverage-experimental' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

Otherwise, it works.

@@ -20241,7 +20241,9 @@ with pkgs;

libcint = callPackage ../development/libraries/libcint { };

libclc = callPackage ../development/libraries/libclc { };
libclc = callPackage ../development/libraries/libclc {
llvmPackages = llvmPackages_latest;
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to?:

Suggested change
llvmPackages = llvmPackages_latest;
llvmPackages = llvmPackages_latest;
spirv-llvm-translator = spirv-llvm-translator_14;

@K900
Copy link
Contributor Author

K900 commented Dec 8, 2022

Have you tested rusticl with luxmark?

I rebased my overlay with yours' mesa + 22.3 branch. When I have /run/opengl-drivers/etc/OpenCL/vendors/rusticl.icd it crashes with:

mesa: CommandLine Error: Option 'limited-coverage-experimental' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

Otherwise, it works.

It looks like trying to load multiple LLVMs in the same process makes things explode, both with Intel and with ROCm. We need to settle on one LLVM version for everything, or have exactly one ICD at a time...

@LunNova
Copy link
Member

LunNova commented Dec 13, 2022

Fix for Arc GPUs merged, no point release yet. It's quite broken without it so please hold off on merging until that's in!

@Atemu
Copy link
Member

Atemu commented Dec 13, 2022

@LunNova we won't merge this until 22.3.1 anyways.

@jansol
Copy link
Contributor

jansol commented Dec 15, 2022

22.3.1 is out now

@K900 K900 changed the base branch from master to staging December 15, 2022 10:03
@K900
Copy link
Contributor Author

K900 commented Dec 19, 2022

Are those not supported on the standalone compiler backend?

@cidkidnix
Copy link
Contributor

Not directly sure, though I couldn't get any EGL/OpenGL anything to work without a newer LLVM, so I suspect they're not supported on standalone

@vcunat
Copy link
Member

vcunat commented Dec 19, 2022

There's #194634

@cidkidnix
Copy link
Contributor

cidkidnix commented Dec 19, 2022

Ooh nice, past the LLVM version the new mesa works 100% fine on my side as well (though with OpenCL disabled)

OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon Graphics (gfx1100, LLVM 15.0.0, DRM 3.49, 6.1.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.3.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.3.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.3.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

@cidkidnix cidkidnix mentioned this pull request Dec 19, 2022
92 tasks
@cidkidnix
Copy link
Contributor

Want to note here:
You have to disable OpenCL and 32bit drivers don't currently compile (fails with linker errors)
looking into the 32bit driver one, though the OpenCL one is just caused by some bad patches on llvmPackages_git.compiler-rt-libc

@LunNova
Copy link
Member

LunNova commented Dec 20, 2022

Fixes #206868

@cidkidnix
Copy link
Contributor

Update on the 32bit issue!

64bit
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon Graphics (gfx1100, LLVM 15.0.6, DRM 3.49, 6.1.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.3.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.3.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.3.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
32bit
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon Graphics (gfx1100, LLVM 15.0.6, DRM 3.49, 6.1.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.3.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.3.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.3.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

I've got it completely working!

@Atemu
Copy link
Member

Atemu commented Dec 20, 2022

@cidkidnix got it working how?

@cidkidnix
Copy link
Contributor

cidkidnix commented Dec 20, 2022

        mesa-but-better = (mesa223.mesa.override { 
          llvmPackages = self.llvmPackages_15; 
          enableOpenCL = false; 
        }).override (super.lib.optionalAttrs self.stdenv.is32bit { 
          llvmPackages = self.pkgsi686Linux.llvmPackages_15;
          enableOpenCL = false;
          stdenv = self.pkgsi686Linux.gcc11Stdenv;
          xorg = self.pkgsi686Linux.xorg;
          wayland = self.pkgsi686Linux.wayland;
          wayland-protocols = self.pkgsi686Linux.wayland-protocols;
          libdrm = self.pkgsi686Linux.libdrm;
          expat = self.pkgsi686Linux.expat;
          libelf = self.pkgsi686Linux.libelf;
        });

mesa223 is this PRs pkgs
this also depends on the WIP llvmPackages_15
@Atemu lmk if you need any more help

@Atemu
Copy link
Member

Atemu commented Dec 20, 2022

@cidkidnix does this PR's pkgsi686Linux.mesa as it currently stands not work on 32bit?

@Shados
Copy link
Member

Shados commented Dec 20, 2022

@cidkidnix that shouldn't be necessary for a 32-bit build; nixpkgs' cross-compilation package set "splicing" mechanism should be feeding in dependencies from the appropriate package set. It works fine for me just altering mesa's callPackage args to take LLVM 15 & disable OpenCL in pkgs/top-level/all-packages.nix.

@LunNova
Copy link
Member

LunNova commented Dec 20, 2022

If you're trying to override both versions then something like this also works.

mesaOverride = mesa: mesa.overrideAttrs ...;
mesa = mesaOverride pkgs.mesa;
mesai686 = mesaOverride pkgs.pkgsi686.mesa;

@cidkidnix
Copy link
Contributor

cidkidnix commented Dec 20, 2022

@cidkidnix that shouldn't be necessary for a 32-bit build; nixpkgs' cross-compilation package set "splicing" mechanism should be feeding in dependencies from the appropriate package set. It works fine for me just altering mesa's callPackage args to take LLVM 15 & disable OpenCL in pkgs/top-level/all-packages.nix.

While I would usually suspect that for some reason 64Bit elfs/so's were being fed into the i686Linux build causing the linker to freak out. I thought splicing should've resolved this for me (as I'm aware of splicing) but it did not.

also good point @LunNova, didn't think of making a function to make it a bit easier

EDIT: to note I have a somewhat weird overlay setup which might be causing some of the splicing issues

@PedroHLC
Copy link
Member

I can confirm this PR works with LLVM14 for x86_64 and i686, for the same GPUs we already support, from 22.3.0 tag to the latest commit in the release_22.3 branch.

Let's merge this one as it is, we can draft a PR for LLVM 15 (for newer GPUs) and maybe another that enhances the rust-toolchain.

@K900
Copy link
Contributor Author

K900 commented Dec 21, 2022

The only thing I'd like to see before merging this is some extra confirmation that Rusticl works, since I currently have no Intel hardware to test on.

@Atemu
Copy link
Member

Atemu commented Dec 21, 2022

@K900 rusticl is still pretty experimental upstream; especially on ARC. If it doesn't work, that's a problem we can fix later (if it's on us to fix at all).

If you don't feel comfortable with it, we could even disable it by default and leave proper rusticl enablement for later. It's great to already have the flag in now for testing; you've already done more than enough for a mere version bump PR IMO.

@K900
Copy link
Contributor Author

K900 commented Dec 21, 2022

I mean, I'm fine with it being buggy, I just want to make sure it works, because if it doesn't, all the LLVM version nonsense can be removed.

@hmenke
Copy link
Member

hmenke commented Dec 23, 2022

Is Mesa 22.3.1 also coming to NixOS 22.11? With the current Mesa 22.2 screensharing is broken on Intel Tiger Lake GPUs: https://gitlab.freedesktop.org/drm/intel/-/issues/4825

@K900
Copy link
Contributor Author

K900 commented Dec 23, 2022

I think we'll have to, as Arc and RDNA3 are both very iffy on 22.2.

@vcunat
Copy link
Member

vcunat commented Dec 23, 2022

Well, that's a tough call. Certainly not before it's in nixos-unstable.

EDIT: maybe we could provide both options.

@K900
Copy link
Contributor Author

K900 commented Dec 23, 2022

The good news is, Rusticl works on Iris:

Number of platforms                               1
  Platform Name                                   rusticl
  Platform Vendor                                 Mesa/X.org
  Platform Version                                OpenCL 3.0 
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions with Version                cl_khr_icd                                                       0x400000 (1.0.0)
  Platform Numeric Version                        0xc00000 (3.0.0)
  Platform Extensions function suffix             MESA
  Platform Host timer resolution                  0ns
WARNING: OpenCL support via iris+clover is incomplete.
For a complete and conformant OpenCL implementation, use
https://github.com/intel/compute-runtime instead

  Platform Name                                   rusticl
Number of devices                                 1
  Device Name                                     Mesa Intel(R) Xe Graphics (TGL GT2)
  Device Vendor                                   Intel
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 3.0 
  Device Numeric Version                          0xc00000 (3.0.0)
  Driver Version                                  22.3.1
  Device OpenCL C Version                         OpenCL C 1.2 
  Device OpenCL C all versions                    OpenCL C                                                         0xc00000 (3.0.0)
                                                  OpenCL C                                                         0x402000 (1.2.0)
                                                  OpenCL C                                                         0x401000 (1.1.0)
                                                  OpenCL C                                                         0x400000 (1.0.0)
  Device OpenCL C features                        __opencl_c_int64                                                 0x400000 (1.0.0)
                                                  __opencl_c_images                                                0x400000 (1.0.0)
                                                  __opencl_c_3d_image_writes                                       0x400000 (1.0.0)
  Latest comfornace test passed                   v0000-01-01-00
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               6
  Max clock frequency                             400MHz
  Device Partition                                (core)
    Max number of sub-devices                     0
    Supported partition types                     None
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             1024
  Preferred work group size multiple (device)     32
  Preferred work group size multiple (kernel)     32
  Max sub-groups per work group                   0
  Preferred / native vector sizes                 
    char                                                 1 / 1       
    short                                                1 / 1       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 0 / 0        (n/a)
    float                                                1 / 1       
    double                                               0 / 0        (n/a)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (n/a)
  Address bits                                    64, Little-Endian
  Global memory size                              1073741824 (1024MiB)
  Error Correction support                        No
  Max memory allocation                           1073741824 (1024MiB)
  Unified memory for Host and Device              Yes
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 No
    Fine-grained buffer sharing                   No
    Fine-grained system sharing                   No
    Atomics                                       No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       4096 bits (512 bytes)
  Preferred alignment for atomics                 
    SVM                                           0 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Atomic memory capabilities                      relaxed, work-group scope
  Atomic fence capabilities                       relaxed, acquire/release, work-group scope
  Max size for global variable                    0
  Preferred total size of global vars             0
  Global Memory cache type                        None
  Image support                                   Yes
    Max number of samplers per kernel             32
    Max size for 1D images from buffer            134217728 pixels
    Max 1D or 2D image array size                 2048 images
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 128
    Max number of write image args                64
    Max number of read/write image args           0
  Pipe support                                    No
  Max number of pipe args                         0
  Max active pipe reservations                    0
  Max pipe packet size                            0
  Local memory type                               Global
  Local memory size                               65536 (64KiB)
  Max number of constant args                     1024
  Max constant buffer size                        134217728 (128MiB)
  Generic address space support                   No
  Max size of kernel argument                     1024
  Queue properties (on host)                      
    Out-of-order execution                        No
    Profiling                                     Yes
  Device enqueue capabilities                     (n/a)
  Queue properties (on device)                    
    Out-of-order execution                        No
    Profiling                                     No
    Preferred size                                0
    Max size                                      0
  Max queues on device                            0
  Max events on device                            0
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      0ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Non-uniform work-groups                       No
    Work-group collective functions               No
    Sub-group independent forward progress        No
    IL version                                    (n/a)
    ILs with version                              (n/a)
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                (n/a)
  Built-in kernels with version                   (n/a)
  Device Extensions                               cl_khr_byte_addressable_store 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_3d_image_writes
  Device Extensions with Version                  cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                  cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                  cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                  cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                  cl_khr_3d_image_writes                                           0x400000 (1.0.0)

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  rusticl
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 rusticl
    Device Name                                   Mesa Intel(R) Xe Graphics (TGL GT2)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 rusticl
    Device Name                                   Mesa Intel(R) Xe Graphics (TGL GT2)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 rusticl
    Device Name                                   Mesa Intel(R) Xe Graphics (TGL GT2)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.1
  ICD loader Profile                              OpenCL 3.0

The bad news is, it might only work with separateDebugInfo = true somehow, I'm double checking to see if I can reproduce.

It is generally useful, and it also makes rusticl work for ??? reasons ???
@K900
Copy link
Contributor Author

K900 commented Dec 23, 2022

It does in fact only work with separateDebugInfo = true. The segfault occurs here: https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/drivers/iris/iris_disk_cache.c#L282 so it might have something to do with .build-id and the assert is optimized out? Maybe? Anyway, I'm not really in the right headspace to investigate it right now, and having debug info for graphics drivers is probably a good idea anyway, so let's enable it.

@SuperSandro2000
Copy link
Member

@ofborg eval

@K900 K900 merged commit 1c8e3b1 into NixOS:staging Dec 24, 2022
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/updates-to-pkgs-not-appearing-in-unstable/24706/1

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

Successfully merging this pull request may close these issues.