Skip to content

rocprim: init at 2.11.0-5.3.1#197337

Closed
Madouura wants to merge 2 commits intoNixOS:masterfrom
Madouura:pr/rocprim
Closed

rocprim: init at 2.11.0-5.3.1#197337
Madouura wants to merge 2 commits intoNixOS:masterfrom
Madouura:pr/rocprim

Conversation

@Madouura
Copy link
Copy Markdown
Contributor

@Madouura Madouura commented Oct 23, 2022

Description of changes

Tracking: #197885
First part in a whole bunch of porting...
rocprim.passthru.tests will likely always fail due to it being in a vm, but I have confirmed the tests generated do work on hardware.
Depends on #197838

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.11 Release Notes (or backporting 22.05 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.

@github-actions github-actions Bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Oct 23, 2022
@Madouura Madouura requested a review from lovesegfault October 23, 2022 07:01
@ofborg ofborg Bot added 8.has: package (new) This PR adds a new package 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: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Oct 23, 2022
@Madouura
Copy link
Copy Markdown
Contributor Author

Cleaned up some things.

@Madouura
Copy link
Copy Markdown
Contributor Author

Now depends on #197838

@Madouura Madouura mentioned this pull request Oct 26, 2022
34 tasks
@Madouura Madouura force-pushed the pr/rocprim branch 4 times, most recently from a1c9204 to ce480c2 Compare October 30, 2022 17:09
@Madouura Madouura changed the title rocprim: init at 2.11.0-5.3.0 rocprim: init at 2.11.0-5.3.1 Oct 30, 2022
@ofborg ofborg Bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Oct 30, 2022
@Flakebi
Copy link
Copy Markdown
Member

Flakebi commented Nov 3, 2022

Sorry, I didn’t have much time yet to look at all the PRs, I hope I get more time next week.

One thing, that I was missing for a long time is running tests for gpu packages (ROCm, amdvlk, etc.). As you noted, using the nixos test framework doesn’t work, because the VM can’t access GPUs.

However, we can also run tests outside a VM and make hardware accessible to derivations with --option extra-sandbox-paths '/sys'.

Here’s an example for a simple OpenCL test. I guess it would benefit from pulling part of that out into a “framework” like make-test-python.nix.
The test can be run with sudo nix-build --option extra-sandbox-paths '/sys' nixos/tests/rocm-opencl.nix.

{
  system ? builtins.currentSystem,
  pkgs ? import ../.. { inherit system; },
  ...
} @ args:
let
  lib = pkgs.lib;
in
pkgs.stdenv.mkDerivation {
  # name = "test-run-${config.name}";
  name = "test-run-rocm-opencl";

  requiredSystemFeatures = [ "nixos-test" ];

  # TODO Use callPackage so we can take packages as arguments?
  nativeBuildInputs = with pkgs; [ clinfo ];

  OCL_ICD_VENDORS = "${pkgs.rocm-opencl-icd}/etc/OpenCL/vendors/";

  # TODO Testing graphics drivers also needs /dev/dri, so make this configurable?
  buildCommand = ''
    mkdir -p $out

    if [[ ! -e /sys ]]; then
      echo 'Run this test as *root* with `--option extra-sandbox-paths '/sys'` and a GPU'
      exit 1
    fi

    # Run test
    # Test fails if the number of platforms is 0
    clinfo | grep -E 'Number of platforms * [1-9]'
  '';

  # passthru = config.passthru;

  meta = with lib.maintainers; {
    maintainers = [ Flakebi ];
  };
}

Comment thread pkgs/development/libraries/rocprim/default.nix Outdated
@Madouura
Copy link
Copy Markdown
Contributor Author

Madouura commented Nov 3, 2022

@Flakebi That's gonna take some doing, and may be better suited to a bigger PR concerning rocm packages.
Should we just remove the nixosTests commits for now and later on try that?

@ofborg ofborg Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 3, 2022
@Flakebi
Copy link
Copy Markdown
Member

Flakebi commented Nov 4, 2022

Should we just remove the nixosTests commits for now and later on try that?

Yes, that sounds good to me.

@Madouura
Copy link
Copy Markdown
Contributor Author

Madouura commented Nov 4, 2022

Rolled into #198770

@Madouura Madouura closed this Nov 4, 2022
@Madouura Madouura deleted the pr/rocprim branch November 4, 2022 13:48
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: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package 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.

3 participants