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

PyTorch: patch libdrm path for ROCm #24

Merged
merged 6 commits into from
Apr 12, 2023

Conversation

max-privatevoid
Copy link
Member

@max-privatevoid max-privatevoid commented Apr 12, 2023

Patches the ROCm variant of PyTorch to look for amdgpu.ids in /tmp/nix-pytorch-rocm___/amdgpu.ids instead of the default /opt/amdgpu/share/libdrm/amdgpu.ids (underscore padding for same path length since we're patching a binary). Also adds scripts to InvokeAI and KoboldAI to link the correct file to this location if required.

Bonus: Sets HSA_OVERRIDE_GFX_VERSION to 10.3.0 by default in InvokeAI and KoboldAI, ensuring that these work on consumer GPUs (as per AMD documentation).

@max-privatevoid
Copy link
Member Author

@MatthewCroughan

@MatthewCroughan
Copy link
Member

This does not quite fix #13 or #2 since GFX800 cards will not work due to https://raw.githubusercontent.com/John-Gee/rocm-arch/d6812d308fee3caf2b6bb01b4d19fe03a6a0e3bd/rocm-opencl-runtime/enable-gfx800.patch not being included in the bin versions of torch/torchvision in Nixpkgs, but it is worth merging asap as it will fix other GPUs in the meantime.

@MatthewCroughan MatthewCroughan merged commit 422bf55 into master Apr 12, 2023
@MatthewCroughan MatthewCroughan deleted the rocm-libdrm-patch-torch-bin branch April 12, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants