Skip to content

Add support for AMD GPUs #425

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

Merged
merged 8 commits into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/renderer/components/Computer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,15 @@ export default function Computer() {
value={server.gpu?.length === 0 ? '❌' : '✅'}
/>
<StatRow
title="CUDA"
title={server?.device_type !== 'amd' ? 'CUDA' : 'ROCm'}
value={server?.device === 'cuda' ? '✅ ' : '❌'}
/>
<StatRow
title="CUDA Version"
title={
server?.device_type !== 'amd'
? 'CUDA Version'
: 'ROCm Version'
}
value={server?.cuda_version}
/>{' '}
<StatRow
Expand Down
13 changes: 10 additions & 3 deletions src/renderer/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import ModelCurrentlyPlayingBar from './ModelCurrentlyPlayingBar';

import TinyMLXLogo from './Shared/TinyMLXLogo';
import TinyNVIDIALogo from './Shared/TinyNVIDIALogo';
import TinyAMDLogo from './Shared/TinyAMDLogo';

function StatsBar({ connection, setConnection }) {
const [cs, setCS] = useState({ cpu: [0], gpu: [0], mem: [0] });
Expand Down Expand Up @@ -147,9 +148,15 @@ function StatsBar({ connection, setConnection }) {
percent={Math.round(gpu?.utilization)}
/>
))}
<span style={{ display: 'flex', alignItems: 'center' }}>
{server?.device == 'cuda' && <TinyNVIDIALogo />}
</span>
{server?.device === 'cuda' && (
<span style={{ display: 'flex', alignItems: 'center' }}>
{server?.device_type === 'nvidia' ? (
<TinyNVIDIALogo />
) : server?.device_type === 'amd' ? (
<TinyAMDLogo />
) : null}
</span>
)}
</Stack>
</span>
</Tooltip>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Plugins/LocalPlugins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function LocalPlugins({
fetcher,
);

const device = serverInfo?.device;
const device = serverInfo?.device_type;

if (error) return 'Failed to fetch plugins for the selected experiment. Please verify the experiment ID and server availability.';
if (isLoading) return <LinearProgress />;
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/Plugins/PluginCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { Box, ButtonGroup, Chip, CircularProgress, Stack } from '@mui/joy';
import { Link } from 'react-router-dom';
import { useState } from 'react';

import TinyMLXLogo from '../Shared/TinyMLXLogo';
import TinyNVIDIALogo from '../Shared/TinyNVIDIALogo';
import { colorArray, mixColorWithBackground } from 'renderer/lib/utils';
import ShowArchitectures from '../Shared/ListArchitectures';

Expand Down Expand Up @@ -74,6 +72,8 @@ export default function PluginCard({
isCompatible =
pluginArchitectures.includes('cuda') ||
pluginArchitectures.includes('cpu');
} else if (machineType === 'amd') {
isCompatible = pluginArchitectures.includes('amd');
} else {
isCompatible = pluginArchitectures.includes('cpu');
}
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/components/Plugins/PluginGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function PluginGallery({
fetchShowExperimental();
}, []);

const device = serverInfo?.device;
const device = serverInfo?.device_type;

const renderFilters = () => (
<FormControl size="sm" sx={{ flex: 1 }}>
Expand Down Expand Up @@ -94,6 +94,9 @@ export default function PluginGallery({
plugin.supported_hardware_architectures.includes('cpu')
);
}
if (machineType === 'amd') {
return plugin.supported_hardware_architectures.includes('amd');
}

return true; // Default to compatible for unknown machine types
};
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/components/Shared/ListArchitectures.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { Box, Chip } from '@mui/joy';
import TinyMLXLogo from './TinyMLXLogo';
import TinyNVIDIALogo from './TinyNVIDIALogo';
import TinyAMDLogo from './TinyAMDLogo';

function mapArchitectureToIcon(arch) {
switch (arch) {
case 'cuda':
return <TinyNVIDIALogo />;
case 'mlx':
return <TinyMLXLogo />;
case 'amd':
return <TinyAMDLogo />;
default:
return (
<Chip key={arch} color="primary">
Expand Down
14 changes: 14 additions & 0 deletions src/renderer/components/Shared/TinyAMDLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default function TinyAMDLogo() {
return (
<svg
fill="#000000"
width="1.5em"
height="1.5em"
viewBox="0 0 24 24"
role="img"
xmlns="http://www.w3.org/2000/svg"
>
<path d="m18.324 9.137 1.559 1.56h2.556v2.557L24 14.814V9.137zM2 9.52l-2 4.96h1.309l.37-.982H3.9l.408.982h1.338L3.432 9.52zm4.209 0v4.955h1.238v-3.092l1.338 1.562h.188l1.338-1.556v3.091h1.238V9.52H10.47l-1.592 1.845L7.287 9.52zm6.283 0v4.96h2.057c1.979 0 2.88-1.046 2.88-2.472 0-1.36-.937-2.488-2.747-2.488zm1.237.91h.792c1.17 0 1.63.711 1.63 1.57 0 .728-.372 1.572-1.616 1.572h-.806zm-10.985.273.791 1.932H2.008zm17.137.307-1.604 1.603v2.25h2.246l1.604-1.607h-2.246z" />
</svg>
);
}
14 changes: 12 additions & 2 deletions src/renderer/components/Shared/TinyNVIDIALogo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
export default function TinyMLXLogo() {
export default function TinyNVIDIALogo() {
return (
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em"><path d="m5.9698 5.86543v-.95636c.09285-.00661.18663-.01156.28219-.01456a5.75152 5.75152 0 0 1 4.33173 2.24749s-1.8534 2.57431-3.84063 2.57431a2.40975 2.40975 0 0 1 -.77329-.12364v-2.9c1.01832.123 1.223.57279 1.83539 1.59325l1.36157-1.148a3.60517 3.60517 0 0 0 -2.66934-1.30361 4.93745 4.93745 0 0 0 -.52762.03112m0-3.15922v1.42853c.09389-.00742.1879-.0134.28219-.0168 3.63754-.12254 6.0073 2.98317 6.0073 2.98317s-2.722 3.31-5.55774 3.31a4.18488 4.18488 0 0 1 -.73175-.06444v.883a4.81728 4.81728 0 0 0 .60938.03947c2.639 0 4.54736-1.34759 6.39542-2.94267.30618.24532 1.56062.8421 1.8186 1.1037-1.75722 1.47088-5.852 2.65644-8.17346 2.65644-.22369 0-.43886-.01352-.64994-.03376v1.241h10.0302v-10.58764zm0 6.88646v.754a4.26109 4.26109 0 0 1 -3.11821-2.97239 5.27645 5.27645 0 0 1 3.11821-1.50885v.8272l-.0038-.0004a2.34214 2.34214 0 0 0 -1.81935.83163 3.25091 3.25091 0 0 0 1.82315 2.06881m-4.33507-2.32834a6.045 6.045 0 0 1 4.33507-2.35526v-.77433c-3.19927.25677-5.9698 2.96637-5.9698 2.96637s1.56908 4.53638 5.9698 4.95171v-.82318c-3.22936-.4063-4.33507-3.96531-4.33507-3.96531z" fill="#76b900"></path></svg>
<svg
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
>
<path
d="m5.9698 5.86543v-.95636c.09285-.00661.18663-.01156.28219-.01456a5.75152 5.75152 0 0 1 4.33173 2.24749s-1.8534 2.57431-3.84063 2.57431a2.40975 2.40975 0 0 1 -.77329-.12364v-2.9c1.01832.123 1.223.57279 1.83539 1.59325l1.36157-1.148a3.60517 3.60517 0 0 0 -2.66934-1.30361 4.93745 4.93745 0 0 0 -.52762.03112m0-3.15922v1.42853c.09389-.00742.1879-.0134.28219-.0168 3.63754-.12254 6.0073 2.98317 6.0073 2.98317s-2.722 3.31-5.55774 3.31a4.18488 4.18488 0 0 1 -.73175-.06444v.883a4.81728 4.81728 0 0 0 .60938.03947c2.639 0 4.54736-1.34759 6.39542-2.94267.30618.24532 1.56062.8421 1.8186 1.1037-1.75722 1.47088-5.852 2.65644-8.17346 2.65644-.22369 0-.43886-.01352-.64994-.03376v1.241h10.0302v-10.58764zm0 6.88646v.754a4.26109 4.26109 0 0 1 -3.11821-2.97239 5.27645 5.27645 0 0 1 3.11821-1.50885v.8272l-.0038-.0004a2.34214 2.34214 0 0 0 -1.81935.83163 3.25091 3.25091 0 0 0 1.82315 2.06881m-4.33507-2.32834a6.045 6.045 0 0 1 4.33507-2.35526v-.77433c-3.19927.25677-5.9698 2.96637-5.9698 2.96637s1.56908 4.53638 5.9698 4.95171v-.82318c-3.22936-.4063-4.33507-3.96531-4.33507-3.96531z"
fill="#76b900"
></path>
</svg>
);
}