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

linux: Enable AMD's amdkfd kernel driver in >= 4.20 #57885

Merged
merged 1 commit into from Apr 2, 2019

Conversation

acowley
Copy link
Contributor

@acowley acowley commented Mar 19, 2019

The amdkfd driver was built (and loaded when support was detected)
without explicit configuration in kernels 4.17-4.19, but not in newer
kernels.

Motivation for this change

This enables the https://github.com/nixos-rocm/nixos-rocm packaging of AMD's ROCm software stack (GPGPU programming with the CUDA-like hip compiler and opencl) to run with an upstream kernel >= 4.20.

The nixos-rocm packaging has existed for some time, beginning with custom AMD kernels that incorporated the necessary drivers, then shifting to a focus on upstream kernels with 4.17. Here is the Issue where the need for this patch was discovered.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The amdkfd driver was built (and loaded when support was detected)
without explicit configuration in kernels 4.17-4.19, but not in newer
kernels.
@acowley
Copy link
Contributor Author

acowley commented Mar 23, 2019

Ping @NeQuissimus (I don't know who else might be able to take a look at this; suggestions welcome.)

@andir
Copy link
Member

andir commented Mar 26, 2019

@GrahamcOfBorg build linuxPackages_latest

@acowley
Copy link
Contributor Author

acowley commented Apr 2, 2019

Ping @samueldr
You took a quick look at this a week ago, and may be able to help me find someone who can move it forward. I have not heard any complaints from my couple reviewer roundups on IRC.

@samueldr
Copy link
Member

samueldr commented Apr 2, 2019

Just saying, the thing I looked at was "why doesn't it work starting with 4.20"; which was because of how it now it apparently is integrated more deeply in the AMD parts, so it has to either be enabled or disabled, it cannot be compiled as a module as before. (The compilation as a module made it automatically available due to the rule of building anything that can be built as a module by default.)


As to whether to get this in or not? I'm not sure what it might mean. It is an option after all. Are there risks to break the GPU drivers for some AMD hardware? Is it benign and simply behind an option flag?

Looks like it should be fine Among others, ubuntu has turned it on. ArchLinux, too turns it on by default. I'm thinking Debian might too, but didn't find a proper bug report or commit (and don't really care at that point).

I'm not seeing any reason to hold this back.

Just checked (just in case) and both 4.19 and 4.20 built here on this PR

@samueldr samueldr merged commit 2f30b79 into NixOS:master Apr 2, 2019
@acowley
Copy link
Contributor Author

acowley commented Apr 2, 2019

Thank you!

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

5 participants