{"id":22347322,"url":"https://github.com/redhat-na-ssa/demo-ocp-gpu","last_synced_at":"2025-07-30T04:33:11.426Z","repository":{"id":193117849,"uuid":"688148858","full_name":"redhat-na-ssa/demo-ocp-gpu","owner":"redhat-na-ssa","description":"Show some magic around GPUs on OpenShift","archived":false,"fork":false,"pushed_at":"2024-04-02T14:53:12.000Z","size":135,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-02T15:59:58.950Z","etag":null,"topics":["code-server","data-science","gpu","nvidia"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-na-ssa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-09-06T18:48:58.000Z","updated_at":"2024-01-26T15:49:31.000Z","dependencies_parsed_at":"2023-10-02T20:03:39.871Z","dependency_job_id":"e701becc-7440-477a-8c25-e480b1108027","html_url":"https://github.com/redhat-na-ssa/demo-ocp-gpu","commit_stats":null,"previous_names":["redhat-na-ssa/demo-ocp-gpu"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-na-ssa%2Fdemo-ocp-gpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-na-ssa%2Fdemo-ocp-gpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-na-ssa%2Fdemo-ocp-gpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-na-ssa%2Fdemo-ocp-gpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-na-ssa","download_url":"https://codeload.github.com/redhat-na-ssa/demo-ocp-gpu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228088846,"owners_count":17867481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-server","data-science","gpu","nvidia"],"created_at":"2024-12-04T10:08:59.863Z","updated_at":"2024-12-04T10:09:00.840Z","avatar_url":"https://github.com/redhat-na-ssa.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo GPUs on OpenShift\n\nSetup Nvidia GPUs on OpenShift with ease. This repo is intended as a foundation for GPU workloads on OpenShift.\n\nInitially `bootstrap.sh` configures GPU time-slicing which allows 2 workloads\nto share a single GPU.\n\n## In addition\n\n- Try out GPUs in OpenShift Dev Spaces via this [devfile.yaml](devfile.yaml)\n- Run [jupyter notebooks](notebooks) with [pytorch](notebooks/00-test-gpu-torch.ipynb)\nor [tensorflow](notebooks/00-test-gpu-tensorflow.ipynb)\n\nThe [components](components) folder is intended for reuse with ArgoCD or OpenShift GitOps.\nFamiliarity with Kustomize will be helpful. This folder contains various ~~secret~~ recipes for `oc apply -k`.\n\n## Prerequisites\n\n- Nvidia GPU hardware or cloud provider with GPU instances\n- OpenShift 4.11+ w/ cluster admin\n- [Internet access](TODO.md)\n- AWS (auto scaling, optional)\n- OpenShift Dev Spaces 3.8.0+ (optional)\n\n[Red Hat Demo Platform](https://demo.redhat.com) Options (Tested)\n\n- \u003ca href=\"https://demo.redhat.com/catalog?item=babylon-catalog-prod/sandboxes-gpte.sandbox-ocp.prod\u0026utm_source=webapp\u0026utm_medium=share-link\" target=\"_blank\"\u003eAWS with OpenShift Open Environment\u003c/a\u003e\n  - 1 x Control Plane - `m5.4xlarge`\n  - 0 x Workers - `m5.2xlarge`\n- \u003ca href=\"https://demo.redhat.com/catalog?item=babylon-catalog-prod/community-content.com-mlops-wksp.prod\u0026utm_source=webapp\u0026utm_medium=share-link\" target=\"_blank\"\u003eMLOps Demo: Data Science \u0026 Edge Practice\u003c/a\u003e\n\n## Quickstart\n\nSetup cluster GPU operators\n\n```\nscripts/bootstrap.sh\n```\n\n## Various Commands\n\nAWS autoscaling w/ OpenShift Dev Spaces\n\n*NOTE: GPU nodes may take 10 - 15 mins to become available*\n\n```\n# aws gpu - load functions\n. scripts/bootstrap.sh\n\n# aws gpu - basic gpu autoscaling\nocp_aws_cluster_autoscaling\n\n# deploy devspaces\nsetup_operator_devspaces\n```\n\nDeploy GPU test pod\n\n```\noc apply -f https://raw.githubusercontent.com/NVIDIA/gpu-operator/master/tests/gpu-pod.yaml\n```\n\nSetup Time Slicing (2x)\n\n```\noc apply -k components/operators/gpu-operator-certified/instance/overlays/time-sliced-2\n```\n\nRequest / Test a GPU workload of 6 GPUs\n\n```\noc apply -k components/demos/nvidia-gpu-verification/overlays/toleration-replicas-6\n\n# check the number of pods\noc -n nvidia-gpu-verification get pods\n```\n\nGet GPU nodes\n\n```\noc get nodes -l node-role.kubernetes.io/gpu\n\noc get nodes \\\n  -l node-role.kubernetes.io/gpu \\\n  -o jsonpath={.items[*].status.allocatable} | jq . | grep nvidia\n```\n\nWatch cluster autoscaler logs\n\n```\noc -n openshift-machine-api logs -f deploy/cluster-autoscaler-default\n```\n\nManually label nodes as GPU (optional)\n\n```\nNODE=worker1.ocp.run\n  oc label node/${NODE} --overwrite \"node-role.kubernetes.io/gpu=\"\n```\n\n## Other Instructions\n\n[Nvidia Multi Instance GPU (MIG) on OpenShift](MIG.md)\n\n## Links\n\n- [Additional Notes](components/operators/gpu-operator-certified/instance/INFO.md)\n- [Docs - AWS GPU Instances](https://aws.amazon.com/ec2/instance-types/#Accelerated_Computing)\n- [Docs - Nvidia GPU Operator on Openshift](https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/openshift/contents.html)\n- [Docs - Nvidia GPU admin dashboard](https://docs.openshift.com/container-platform/4.11/monitoring/nvidia-gpu-admin-dashboard.html)\n- [Docs - Multi Instance GPU (MIG) in OCP](https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/openshift/mig-ocp.html)\n- [Docs - Time Slicing in OCP](https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/openshift/time-slicing-gpus-in-openshift.html)\n- [Docs - KB GPU Autoscaling](https://access.redhat.com/solutions/6055181)\n  - [Docs - cluster-api/accelerator label](https://bugzilla.redhat.com/show_bug.cgi?id=1943194#c85)\n- [Blog - RH Nvidia GPUs on OpenShift](https://cloud.redhat.com/blog/autoscaling-nvidia-gpus-on-red-hat-openshift)\n- [Demo - bkoz GPU DevSpaces](https://github.com/bkoz/devspaces)\n- [GPU Operator default config map](https://gitlab.com/nvidia/kubernetes/gpu-operator/-/blob/v23.6.1/assets/state-mig-manager/0400_configmap.yaml?ref_type=tags)\n\n## Container License\n\n`udi-cuda` images from [HERE](https://github.com/redhat-na-ssa/demo-ocp-gpu/pkgs/container/udi-cuda) are based on [official NVIDIA CUDA images](https://hub.docker.com/r/nvidia/cuda).\n\nPlease be aware of any of the associated terms and conditions.\n\n```\nThis container image and its contents are governed by the NVIDIA Deep Learning Container License.\n\nBy pulling and using the container, you accept the terms and conditions of this license:\nhttps://developer.nvidia.com/ngc/nvidia-deep-learning-container-license\n\nA copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-na-ssa%2Fdemo-ocp-gpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-na-ssa%2Fdemo-ocp-gpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-na-ssa%2Fdemo-ocp-gpu/lists"}