Skip to content

Commit

Permalink
Publish Metal 31001 patches for Sequoia!
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Aug 18, 2024
1 parent 5d86ad8 commit 7472355
Show file tree
Hide file tree
Showing 152 changed files with 45,885 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>20A241133</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>AMDMTLBronzeDriver</string>
<key>CFBundleGetInfoString</key>
<string>AMDMTLBronzeDriver 4.8.101 24119</string>
<key>CFBundleIdentifier</key>
<string>com.apple.AMDMTLBronzeDriver</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AMD Bronze Metal Driver</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>4.8.101</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>4.0.8</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>21G71</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>12.5</string>
<key>DTSDKBuild</key>
<string>21G71</string>
<key>DTSDKName</key>
<string>macosx12.5.internal</string>
<key>DTXcode</key>
<string>1330</string>
<key>DTXcodeBuild</key>
<string>13E6049a</string>
<key>LSMinimumSystemVersion</key>
<string>12.5</string>
<key>NSPrincipalClass</key>
<string>BronzeMtlDevice</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BNDL????
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
var MemBandWidth = MemClkFreq / 100000 * MemBusWidth / 8 * 4; // GB/s
var MaxPixelRate = NumROP * 4; // Pixels/EngineClk

var waSEVERITY_HIGH = 2;
var waSEVERITY_MEDIUM = 1;
var waSEVERITY_LOW = 0;

function analysis_TextureSamplingInst_bound()
{
var ALUActiveThreshold = 20;
var MemoryStallThreshold = 40;
var ShaderCostThreshold = 70;
var TextureUnitBusyThreshold = 60;
var SamplerBusyThreshold = 60;

var specificShaderStall = false;
if ((ShaderCoreALUActive < ALUActiveThreshold) && (MemoryStallPerWavefrontCompute > MemoryStallThreshold) && (MTLStatComputeCost > ShaderCostThreshold) && (SamplerBusy > SamplerBusyThreshold))
{
specificShaderStall = true;
var problemId = ReportProblem(0.3, "Compute shader is texture sampling bound", waSEVERITY_HIGH);
AddProblemSubItem(problemId, "The compute shader has a Low ALU to Memory instruction ratio and a high rate of sampling instruction stalls")
AddProblemSubItem(problemId, "Optimize texture sampling instructions in the compute shader, or increase the ALU workload to take advantage of stalled cycles", "ComputeShader")
}
if ((ShaderCoreALUActive < ALUActiveThreshold) && (MemoryStallPerWavefrontVertex > MemoryStallThreshold) && (MTLStatVertexCost > ShaderCostThreshold) && (SamplerBusy > SamplerBusyThreshold))
{
specificShaderStall = true;
var problemId = ReportProblem(0.3, "Vertex shader is texture sampling bound", waSEVERITY_HIGH);
AddProblemSubItem(problemId, "The vertex shader has a Low ALU to Memory instruction ratio and a high rate of sampling instruction stalls")
AddProblemSubItem(problemId, "Optimize texture sampling instructions in the vertex shader, or increase the ALU workload to take advantage of stalled cycles", "VertexShader")
}
if ((ShaderCoreALUActive < ALUActiveThreshold) && (MemoryStallPerWavefrontFragment > MemoryStallThreshold) && (MTLStatFragmentCost > ShaderCostThreshold) && (SamplerBusy > SamplerBusyThreshold))
{
specificShaderStall = true;
var problemId = ReportProblem(0.3, "Fragment shader is texture sampling bound", waSEVERITY_HIGH);
AddProblemSubItem(problemId, "The fragment shader has a Low ALU to Memory instruction ratio and a high rate of sampling instruction stalls")
AddProblemSubItem(problemId, "Optimize texture sampling instructions in the fragment shader, or increase the ALU workload to take advantage of stalled cycles", "FragmentShader")
}

if (specificShaderStall == false && (ShaderCoreALUActive < ALUActiveThreshold) && (MemoryStallPerWavefront > MemoryStallThreshold) && (MTLStatShaderCost > ShaderCostThreshold) && (SamplerBusy > SamplerBusyThreshold))
{
var problemId = ReportProblem(0.3, "Shading is texture sampling bound", waSEVERITY_HIGH);
AddProblemSubItem(problemId, "The shaders have a Low ALU to Memory instruction ratio and a high rate of sampling instruction stalls")
AddProblemSubItem(problemId, "Optimize texture sampling instructions in the shaders, or increase the ALU workload to take advantage of stalled cycles", "BoundResources")
}

}

function analysis_shaderALU_bound()
{
var ALUActiveThreshold = 75;
var ShaderCostThreshold = 70;

if ((ShaderCoreALUActive > ALUActiveThreshold) && (MTLStatVertexCost > ShaderCostThreshold))
{
var problemId = ReportProblem(0.3, "Vertex shader is ALU instruction bound", waSEVERITY_HIGH);
AddProblemSubItem(problemId, "Optimize ALU instructions in the vertex shader", "VertexShader");
}
if ((ShaderCoreALUActive > ALUActiveThreshold) && (MTLStatFragmentCost > ShaderCostThreshold))
{
var problemId = ReportProblem(0.3, "Fragment shader is ALU instruction bound", waSEVERITY_HIGH);
AddProblemSubItem(problemId, "Optimize ALU instructions in the fragment shader", "FragmentShader");
}
if ((ShaderCoreALUActive > ALUActiveThreshold) && (MTLStatComputeCost > ShaderCostThreshold))
{
var problemId = ReportProblem(0.3, "Shader is ALU instruction bound", waSEVERITY_HIGH);
AddProblemSubItem(problemId, "Optimize ALU instructions in the compute shader", "Kernel");
}
}

function analysis_memory_bound()
{
var totalMemBandwidth = ColorBlockDramBandwidth + L2CacheDramBandwidth + DepthBlockDramBandwidth;

if (totalMemBandwidth > (MemBandwidth * 0.7))
{
var problemId = ReportProblem(0.3, "Memory bandwidth bound", "Reduce memory access", waSEVERITY_MEDIUM);
AddProblemSubItem(problemId, "Reduce overall use of memory bandwidth")
}
}

function analysis_pixelRate_bound()
{
var blendingOn = (AMDStat_CBMemRead == 0) ? 1 : 2;
if (PixelRate > ((MaxPixelRate / blendingOn) * 0.8))
{
var severity = waSEVERITY_LOW;

if ((NumMRT > 2) || (blendingOn == 2))
{
severity = waSEVERITY_MEDIUM;
}

var problemId = ReportProblem(0.3, "Pixel rate bound", severity);
AddProblemSubItem(problemId, "Performance is bound by the maximum rate the GPU can write pixels");

if (NumMRT > 2)
{
AddProblemSubItem(problemId, "Consider decreasing the number of MRTs if possible");
}

if (blendingOn == 2)
{
AddProblemSubItem(problemId, "Blending is on, which will reduce the maximum pixel rate, check if blending needs to be turned on")
}
}
}

function analysis_primitiveRate_bound()
{
if (AMDStat_FrontEndBusy > 0)
{
var stallRate = AMDStat_FrontEndStall / AMDStat_GPU_Engine_Busy_Ticks / NumSE;
var busyRate = AMDStat_FrontEndStarvedBusy / AMDStat_GPU_Engine_Busy_Ticks / NumSE;
var peakPrimitiveRate = NumSE;
if ((stallRate < 0.3) && (busyRate > 0.6))
{
if (PrimitiveRate < (peakPrimitiveRate * 0.4))
{
var problemId = ReportProblem(0.3, "Low primitive rate", waSEVERITY_MEDIUM);
AddProblemSubItem(problemId, "Try to reuse vertices to attain higher primitive rate")
if (ParameterCacheStall > 70)
{
problemId = ReportProblem(0.3, "Vertex shader output bound", waSEVERITY_HIGH);
AddProblemSubItem(problemId, "Optimize the number of attributes output by the vertex shader", "VertexShader")
}
}
else
{
var problemId = ReportProblem(0.3, "Front end primitive bound", waSEVERITY_LOW);
AddProblemSubItem(problemId, "Performance is bound by the maximum rate the GPU can process primitives")
}
}
}
}

Loading

0 comments on commit 7472355

Please sign in to comment.