Skip to content

Comments

SPIRV-LLVM-Translator: Add llvm-spirv tool; libclc: 11.0.1 -> 12.0.1#162603

Merged
Lassulus merged 2 commits intoNixOS:stagingfrom
jljusten:libclc-spirv
May 4, 2022
Merged

SPIRV-LLVM-Translator: Add llvm-spirv tool; libclc: 11.0.1 -> 12.0.1#162603
Lassulus merged 2 commits intoNixOS:stagingfrom
jljusten:libclc-spirv

Conversation

@jljusten
Copy link
Contributor

@jljusten jljusten commented Mar 3, 2022

The SPIRV-LLVM-Translator is updated to install the llvm-spirv tool. Unfortunately this tool is not installed as part of the normal 'make install' process so I added postBuild and postInstall.

libclc is upgraded from 11.0.1 to 12.0.1. In 12.0.0, libclc started using the llvm-spirv tool to create to spv files:

  • spirv64-mesa3d-.spv
  • spirv-mesa3d-.spv
Motivation for this change

The Mesa project is starting to make use of these SPIR-V libraries. It can be used by some drivers for opencl now, and potentially in the future for Vulkan ray-tracing support.

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/)
    • llvm-spirv was used by the libclc 12 build process
  • 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.

@ofborg ofborg bot requested a review from gloaming March 3, 2022 11:05
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Mar 3, 2022
@ofborg ofborg bot requested a review from gloaming April 10, 2022 08:19
@Lassulus
Copy link
Member

This will make ${self.spirv-llvm-translator}/bin/llvm-spirv available.

As of llvmorg-12.0.0, libclc can now build SPIR-V based libraries, but
requires the llvm-spirv build tool for this.

Ref: https://github.com/llvm/llvm-project/blob/llvmorg-12.0.0/libclc/CMakeLists.txt#L98
Signed-off-by: Jordan Justen <[email protected]>
As part of the upgrade to 12.0.1, now 2 SPIR-V libraries will now be
made available:

 * spirv64-mesa3d-.spv
 * spirv-mesa3d-.spv

Signed-off-by: Jordan Justen <[email protected]>
@jljusten
Copy link
Contributor Author

@Lassulus: Thanks for letting me know about this. I rebased the 2 patches to the merge-base of the master and staging branches.

@Lassulus
Copy link
Member

I guess you still need to change the target branch to staging instead of master

@ofborg ofborg bot added 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. and removed 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Apr 19, 2022
@jljusten jljusten changed the base branch from master to staging April 19, 2022 09:44
@Lassulus Lassulus requested a review from primeos April 19, 2022 11:40
Copy link
Member

@primeos primeos left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. The diff LGTM but unfortunately I don't have the background knowledge and time to properly review this (not even sure why a review from me was requested here - I'm roughly familiar with the technologies but don't actively use them and IIRC I didn't really touch those Nix expressions before).

But while I'm at it: I just opened #170095 regarding a long-standing libclc "issue" (it's out of scope for this PR but would probably be useful in general).

@Artturin Artturin added the 12.approvals: 1 This PR was reviewed and approved by one person. label May 4, 2022
Copy link
Member

@ivan ivan left a comment

Choose a reason for hiding this comment

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

I applied this to nixpkgs master and did not encounter issues when building an x86_64 NixOS 22.05-pre that depends on this through ffmpeg -> mesa -> libclc. Also, this release has been out for a while, and I would guess it is safe to use.

@Lassulus Lassulus merged commit a6902b3 into NixOS:staging May 4, 2022
calbrecht added a commit to calbrecht/nixpkgs that referenced this pull request May 6, 2022
See
NixOS#171656 (comment)

there was a conflict with NixOS#162603 and a GitHub Action did a bad merge in 4cab9ae#diff-1aeab0da45b3afb6688d321042021a2ebad96758fc495d92aaadb50cc9aa22c7R28, adding a second makeFlags and breaking the build.
calbrecht added a commit to calbrecht/nixpkgs that referenced this pull request May 6, 2022
See
NixOS#171656 (comment)

there was a conflict with NixOS#162603 and a GitHub Action did a bad merge in 4cab9ae#diff-1aeab0da45b3afb6688d321042021a2ebad96758fc495d92aaadb50cc9aa22c7R28, adding a second makeFlags and breaking the build.
calbrecht added a commit to calbrecht/nixpkgs that referenced this pull request May 6, 2022
See
NixOS#171656 (comment)

there was a conflict with NixOS#162603 and a GitHub Action did a bad merge in 4cab9ae#diff-1aeab0da45b3afb6688d321042021a2ebad96758fc495d92aaadb50cc9aa22c7R28, adding a second makeFlags and breaking the build.
@bobby285271
Copy link
Member

bobby285271 commented May 6, 2022

I direct pushed 5ee3e9f to staging to fix the eval, sorry I did not really read the changes here, please take a look at #171784, thanks!

attribute 'makeFlags' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-5/pkgs/development/compilers/spirv-llvm-translator/default.nix:40:3 already defined at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-5/pkgs/development/compilers/spirv-llvm-translator/default.nix:28:3

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

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants