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

rocprim: init at 2.11.0-5.3.1 #197337

Closed
wants to merge 2 commits into from
Closed

Conversation

Madouura
Copy link
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.

@Madouura
Copy link
Contributor Author

Cleaned up some things.

@Madouura
Copy link
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
@Flakebi
Copy link
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 ];
  };
}

@Madouura
Copy link
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?

@Flakebi
Copy link
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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants