Add AMDGpu wrapper for free amd driver

This commit is contained in:
Guillaume Bouchard 2020-05-09 22:58:52 +02:00
parent 5f330c2185
commit ad21f20321
3 changed files with 24 additions and 0 deletions

View File

@ -47,6 +47,7 @@ configuration.
- `nix-env -f ./ -iA nixGLIntel`: Mesa OpenGL implementation (intel, amd, nouveau, ...).
- `nix-env -f ./ -iA nixGLNvidiaBumblebee`: Proprietary Nvidia driver on hybrid hardware.
- `nix-env -f ./ -iA nixGLNvidia`: Proprietary Nvidia driver.
- `nix-env -f ./ -iA nixGLAmdGPU`: Free AMDGpu driver.
- `nix-env -f ./ -iA nixGLDefault`: Tries to auto-detect and install Nvidia,
if not, fallback to mesa.

View File

@ -95,6 +95,14 @@ main = do
describe "Vulkan" $ do
checkVulkan "Mesa" "nixVulkanIntel"
describe "AMD GPU" $ do
describe "OpenGL" $ do
-- TODO: fill the right name for glxinfo data
checkOpenGL "AMD" "nixGLAmdGPU"
xdescribe "Vulkan" $ do
-- Not tested yet
checkVulkan "AMD" "nixVulkanAmdGPU"
describe "Nvidia - Bumblebee" $ do
describe "OpenGL" $ do
checkOpenGL "NVIDIA" "nixGLNvidiaBumblebee"

View File

@ -178,6 +178,21 @@ in
'';
};
# Support for amdgpu
nixGLAmdGPU = writeExecutable {
name = "nixGLAmdGPU";
# add the 32 bits drivers if needed
text = let
drivers = [xorg.xf86videoamdgpu] ++ lib.optional enable32bits pkgsi686Linux.xorg.xf86videoamdgpu;
in ''
#!/usr/bin/env sh
export LD_LIBRARY_PATH=${
lib.makeLibraryPath drivers
}:$LD_LIBRARY_PATH
"$@"
'';
};
nixGLCommon = nixGL:
runCommand "nixGLCommon" {
buildInuts = [nixGL];