Skip to content

Commit

Permalink
chore: added comments to gpu example
Browse files Browse the repository at this point in the history
  • Loading branch information
mgordel committed Sep 5, 2024
1 parent 917ec43 commit 03446f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions examples/rental-model/advanced/gpu/gpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger";
const order: MarketOrderSpec = {
demand: {
workload: {
imageHash: "594a2491e578f7ad817d1996bd181b44130d22f3f2db6160214a60b4",
imageTag: "nvidia/cuda:12.6.0-cudnn-runtime-ubuntu24.04",
capabilities: ["!exp:gpu"],
runtime: {
name: "vm-nvidia",
Expand All @@ -34,12 +34,19 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger";
const rental = await glm.oneOf({ order });
const exe = await rental.getExeUnit();

await exe.uploadFile("./bandwidth-test", "/storage/bandwidth-test");
await exe.run("chmod +x /storage/bandwidth-test");
// The executable binary from the Samples for CUDA Developers package.
// This is a simple test program to measure the memcopy bandwidth of the GPU.
// https://github.com/NVIDIA/cuda-samples
await exe.uploadFile("./bandwidthTest", "/storage/bandwidthTest");
await exe.run("chmod +x /storage/bandwidthTest");

console.log((await exe.run("/storage/bandwidth-test")).stdout);
const bandwidthResult = await exe.run("/storage/bandwidthTest");
console.log("\nCUDA Bandwidth Test:\n\n", bandwidthResult.stdout);

console.log((await exe.run("nvidia-smi")).stdout);
// Run native command nvidia-smi provided by nvidia driver.
// https://developer.nvidia.com/system-management-interface
const nvidiaSmiResult = await exe.run("nvidia-smi");
console.log("\n\nNVIDIA SMI Test:\n\n", nvidiaSmiResult.stdout);

await rental.stopAndFinalize();
} catch (err) {
Expand Down

0 comments on commit 03446f6

Please sign in to comment.