import{s as ke,n as Le,o as Ze}from"../chunks/scheduler.f3b1e791.js";import{S as _e,i as Xe,e as i,s as a,c as h,h as je,a as o,d as l,b as s,f as ie,g as u,j as c,k as Je,l as r,m as n,n as f,t as $,o as T,p as M}from"../chunks/index.023a9934.js";import{C as Ne}from"../chunks/CopyLLMTxtMenu.ee636735.js";import{C as oe}from"../chunks/CodeBlock.5aa52fca.js";import{H as ue,E as We}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.9b009efe.js";function Ye(fe){let d,E,V,R,b,S,y,P,w,$e=`Instructions on this page assume that you installed Nix with the
<a href="https://docs.determinate.systems/determinate-nix/" rel="nofollow">Determinate Nix installer</a>.`,A,C,H,G,Te=`Since new macOS versions get <a href="https://telemetrydeck.com/survey/apple/macOS/versions/" rel="nofollow">adopted quickly</a>,
we only support the latest major macOS version except for the first weeks
after a release, when we also support the previous major version.`,Q,g,Me="We currently support macOS 26.0 and later on ARM64 (Apple silicon).",O,J,q,k,ve="To build a Metal kernel, the following requirements must be met:",D,m,Y,xe="<p>Xcode 26.x must be available on the build machine.</p>",re,z,be=`<p><code>xcode-select -p</code> must point to the Xcode 26 installation, typically
<code>/Applications/Xcode.app/Contents/Developer</code>. If this is not the case,
you can set the path with:
<code>sudo xcode-select -s /path/to/Xcode.app/Contents/Developer</code></p>`,me,F,ye=`<p>The Metal Toolchain must be installed. Starting with macOS 26, this is
a separate download from Xcode. You can install it with:
<code>xcodebuild -downloadComponent MetalToolchain</code></p>`,pe,p,B,we=`The Nix sandbox should be set to <code>relaxed</code>, because the Nix derivation
that builds the kernel must have access to Xcode and the Metal Toolchain.
You can verify this by checking that <code>/etc/nix/nix.custom.conf</code> contains
the line:`,ce,L,de,U,Ce="If you had to add the line, make sure to restart the Nix daemon:",he,Z,K,_,Ge=`You can check these requirements as follows. First, you can check the Xcode
version as follows:`,ee,X,te,j,ge=`The reported version must be 26.0 or newer. Then you can validate that the
Metal Toolchain is installed with:`,le,N,ne,W,ae,I,se;return b=new Ne({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),y=new ue({props:{title:"Metal kernels 🤘",local:"metal-kernels-",headingTag:"h1"}}),C=new ue({props:{title:"Targeted macOS versions",local:"targeted-macos-versions",headingTag:"h2"}}),J=new ue({props:{title:"Requirements",local:"requirements",headingTag:"h2"}}),L=new oe({props:{code:"c2FuZGJveCUyMCUzRCUyMHJlbGF4ZWQ=",highlighted:'<span class="hljs-attribute">sandbox</span> <span class="hljs-operator">=</span> relaxed',wrap:!1}}),Z=new oe({props:{code:"c3VkbyUyMGxhdW5jaGN0bCUyMGtpY2tzdGFydCUyMC1rJTIwc3lzdGVtJTJGc3lzdGVtcy5kZXRlcm1pbmF0ZS5uaXgtZGFlbW9u",highlighted:'sudo launchctl kickstart -k <span class="hljs-params">system</span>/<span class="hljs-params">system</span>s.determinate.nix-daemon',wrap:!1}}),X=new oe({props:{code:"JTI0JTIweGNvZGVidWlsZCUyMC12ZXJzaW9uJTBBWGNvZGUlMjAyNi4xJTBBQnVpbGQlMjB2ZXJzaW9uJTIwMTdCNTU=",highlighted:`$ xcodebuild -version
Xcode 26.1
Build version 17B55`,wrap:!1}}),N=new oe({props:{code:"JTI0JTIweGNvZGVidWlsZCUyMC1zaG93Q29tcG9uZW50JTIwbWV0YWxUb29sY2hhaW4lMEFBc3NldCUyMFBhdGglM0ElMjAlMkZTeXN0ZW0lMkZMaWJyYXJ5JTJGQXNzZXRzVjIlMkZjb21fYXBwbGVfTW9iaWxlQXNzZXRfTWV0YWxUb29sY2hhaW4lMkY2OGQ4ZGI2MjEyYjQ4ZDM4N2QwNzFmZjdiOTA1ZGY3OTY2NThlNzEzLmFzc2V0JTJGQXNzZXREYXRhJTBBQnVpbGQlMjBWZXJzaW9uJTNBJTIwMTdCNTQlMEFTdGF0dXMlM0ElMjBpbnN0YWxsZWQlMEFUb29sY2hhaW4lMjBJZGVudGlmaWVyJTNBJTIwY29tLmFwcGxlLmR0LnRvb2xjaGFpbi5NZXRhbC4zMjAyMyUwQVRvb2xjaGFpbiUyMFNlYXJjaCUyMFBhdGglM0ElMjAlMkZwcml2YXRlJTJGdmFyJTJGcnVuJTJGY29tLmFwcGxlLnNlY3VyaXR5LmNyeXB0ZXhkJTJGbW50JTJGY29tLmFwcGxlLk1vYmlsZUFzc2V0Lk1ldGFsVG9vbGNoYWluLXYxNy4yLjU0LjAubUR4Z3ow",highlighted:`$ xcodebuild -showComponent metalToolchain
Asset Path: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/68d8db6212b48d387d071ff7b905df796658e713.asset/AssetData
Build Version: 17B54
Status: installed
Toolchain Identifier: com.apple.dt.toolchain.Metal.32023
Toolchain Search Path: /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.2.54.0.mDxgz0`,wrap:!1}}),W=new We({props:{source:"https://github.com/huggingface/kernels/blob/main/docs/source/builder/metal.md"}}),{c(){d=i("meta"),E=a(),V=i("p"),R=a(),h(b.$$.fragment),S=a(),h(y.$$.fragment),P=a(),w=i("p"),w.innerHTML=$e,A=a(),h(C.$$.fragment),H=a(),G=i("p"),G.innerHTML=Te,Q=a(),g=i("p"),g.textContent=Me,O=a(),h(J.$$.fragment),q=a(),k=i("p"),k.textContent=ve,D=a(),m=i("ul"),Y=i("li"),Y.innerHTML=xe,re=a(),z=i("li"),z.innerHTML=be,me=a(),F=i("li"),F.innerHTML=ye,pe=a(),p=i("li"),B=i("p"),B.innerHTML=we,ce=a(),h(L.$$.fragment),de=a(),U=i("p"),U.textContent=Ce,he=a(),h(Z.$$.fragment),K=a(),_=i("p"),_.textContent=Ge,ee=a(),h(X.$$.fragment),te=a(),j=i("p"),j.textContent=ge,le=a(),h(N.$$.fragment),ne=a(),h(W.$$.fragment),ae=a(),I=i("p"),this.h()},l(e){const t=je("svelte-u9bgzb",document.head);d=o(t,"META",{name:!0,content:!0}),t.forEach(l),E=s(e),V=o(e,"P",{}),ie(V).forEach(l),R=s(e),u(b.$$.fragment,e),S=s(e),u(y.$$.fragment,e),P=s(e),w=o(e,"P",{"data-svelte-h":!0}),c(w)!=="svelte-10ipj7f"&&(w.innerHTML=$e),A=s(e),u(C.$$.fragment,e),H=s(e),G=o(e,"P",{"data-svelte-h":!0}),c(G)!=="svelte-1uzpta1"&&(G.innerHTML=Te),Q=s(e),g=o(e,"P",{"data-svelte-h":!0}),c(g)!=="svelte-ganqnk"&&(g.textContent=Me),O=s(e),u(J.$$.fragment,e),q=s(e),k=o(e,"P",{"data-svelte-h":!0}),c(k)!=="svelte-yrhmt8"&&(k.textContent=ve),D=s(e),m=o(e,"UL",{});var v=ie(m);Y=o(v,"LI",{"data-svelte-h":!0}),c(Y)!=="svelte-3n8ej0"&&(Y.innerHTML=xe),re=s(v),z=o(v,"LI",{"data-svelte-h":!0}),c(z)!=="svelte-ekclvr"&&(z.innerHTML=be),me=s(v),F=o(v,"LI",{"data-svelte-h":!0}),c(F)!=="svelte-1glw3nn"&&(F.innerHTML=ye),pe=s(v),p=o(v,"LI",{});var x=ie(p);B=o(x,"P",{"data-svelte-h":!0}),c(B)!=="svelte-cqz5v3"&&(B.innerHTML=we),ce=s(x),u(L.$$.fragment,x),de=s(x),U=o(x,"P",{"data-svelte-h":!0}),c(U)!=="svelte-1r9uvm3"&&(U.textContent=Ce),he=s(x),u(Z.$$.fragment,x),x.forEach(l),v.forEach(l),K=s(e),_=o(e,"P",{"data-svelte-h":!0}),c(_)!=="svelte-1kyy8bl"&&(_.textContent=Ge),ee=s(e),u(X.$$.fragment,e),te=s(e),j=o(e,"P",{"data-svelte-h":!0}),c(j)!=="svelte-5cjmjo"&&(j.textContent=ge),le=s(e),u(N.$$.fragment,e),ne=s(e),u(W.$$.fragment,e),ae=s(e),I=o(e,"P",{}),ie(I).forEach(l),this.h()},h(){Je(d,"name","hf:doc:metadata"),Je(d,"content",ze)},m(e,t){r(document.head,d),n(e,E,t),n(e,V,t),n(e,R,t),f(b,e,t),n(e,S,t),f(y,e,t),n(e,P,t),n(e,w,t),n(e,A,t),f(C,e,t),n(e,H,t),n(e,G,t),n(e,Q,t),n(e,g,t),n(e,O,t),f(J,e,t),n(e,q,t),n(e,k,t),n(e,D,t),n(e,m,t),r(m,Y),r(m,re),r(m,z),r(m,me),r(m,F),r(m,pe),r(m,p),r(p,B),r(p,ce),f(L,p,null),r(p,de),r(p,U),r(p,he),f(Z,p,null),n(e,K,t),n(e,_,t),n(e,ee,t),f(X,e,t),n(e,te,t),n(e,j,t),n(e,le,t),f(N,e,t),n(e,ne,t),f(W,e,t),n(e,ae,t),n(e,I,t),se=!0},p:Le,i(e){se||($(b.$$.fragment,e),$(y.$$.fragment,e),$(C.$$.fragment,e),$(J.$$.fragment,e),$(L.$$.fragment,e),$(Z.$$.fragment,e),$(X.$$.fragment,e),$(N.$$.fragment,e),$(W.$$.fragment,e),se=!0)},o(e){T(b.$$.fragment,e),T(y.$$.fragment,e),T(C.$$.fragment,e),T(J.$$.fragment,e),T(L.$$.fragment,e),T(Z.$$.fragment,e),T(X.$$.fragment,e),T(N.$$.fragment,e),T(W.$$.fragment,e),se=!1},d(e){e&&(l(E),l(V),l(R),l(S),l(P),l(w),l(A),l(H),l(G),l(Q),l(g),l(O),l(q),l(k),l(D),l(m),l(K),l(_),l(ee),l(te),l(j),l(le),l(ne),l(ae),l(I)),l(d),M(b,e),M(y,e),M(C,e),M(J,e),M(L),M(Z),M(X,e),M(N,e),M(W,e)}}}const ze='{"title":"Metal kernels 🤘","local":"metal-kernels-","sections":[{"title":"Targeted macOS versions","local":"targeted-macos-versions","sections":[],"depth":2},{"title":"Requirements","local":"requirements","sections":[],"depth":2}],"depth":1}';function Fe(fe){return Ze(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Re extends _e{constructor(d){super(),Xe(this,d,Fe,Ye,ke,{})}}export{Re as component};
