{"id":24446019,"url":"https://github.com/chaunceyjiang/fake-gpu","last_synced_at":"2025-03-14T04:42:33.383Z","repository":{"id":271878924,"uuid":"914837882","full_name":"chaunceyjiang/fake-gpu","owner":"chaunceyjiang","description":"This project is designed to simulate GPU information, making it easier to test scenarios where a GPU is not available.","archived":false,"fork":false,"pushed_at":"2025-03-04T11:37:33.000Z","size":4609,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T12:32:00.018Z","etag":null,"topics":["fake","gpu","kubernetes","simulation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaunceyjiang.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,"publiccode":null,"codemeta":null}},"created_at":"2025-01-10T12:11:02.000Z","updated_at":"2025-03-04T11:37:36.000Z","dependencies_parsed_at":"2025-01-10T13:47:11.972Z","dependency_job_id":"3bd676bc-9659-4cc4-a4ba-05fef7e82b0e","html_url":"https://github.com/chaunceyjiang/fake-gpu","commit_stats":null,"previous_names":["chaunceyjiang/fake-gpu"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyjiang%2Ffake-gpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyjiang%2Ffake-gpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyjiang%2Ffake-gpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyjiang%2Ffake-gpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaunceyjiang","download_url":"https://codeload.github.com/chaunceyjiang/fake-gpu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243526853,"owners_count":20305112,"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":["fake","gpu","kubernetes","simulation"],"created_at":"2025-01-20T23:32:03.734Z","updated_at":"2025-03-14T04:42:33.374Z","avatar_url":"https://github.com/chaunceyjiang.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fake-gpu\n\n## Project Overview\n\nThe `fake-gpu` project is designed to simulate GPU information, making it easier to test scenarios where a GPU is not available. This can be particularly useful for development and testing purposes in environments that lack physical GPU hardware.\n\n## Features\n- Simulate GPU information through configuration files\n- Unable to Perform Genuine CUDA Computation\n- Test GPU-related functions without GPU hardware\n- Non-intrusive, no need to modify application code\n- Supports CUDA Driver, CUDA Runtime, NVML API\n- Supports nvidia-smi\n- Supports DCGM-Exporter\n\n## Requirements\n- containerd \u003e= 1.7.0\n\n## Usage\n\nTo use the fake GPU, follow these steps:\n\nYou should have a Kubernetes cluster running with containerd as the container runtime.\nYou should have already deployed [nvidia-device-plugin](https://github.com/NVIDIA/k8s-device-plugin) or [HAMi](https://github.com/Project-HAMi/HAMi).\n\n### Option 1: Deploy the [nvidia-device-plugin](https://github.com/NVIDIA/k8s-device-plugin)\n``` shell\n kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.17.0/deployments/static/nvidia-device-plugin.yml\n```\n### Option 2: Deploy the [HAMi](https://github.com/Project-HAMi/HAMi)\n``` shell\nhelm repo add hami-charts https://project-hami.github.io/HAMi/\nhelm install hami hami-charts/hami  -n kube-system\n\n```\n\n### Deploy the fake GPU \n1. Download the latest release of the fake GPU.\n``` shell\nhelm repo add fake-gpu-charts https://chaunceyjiang.github.io/fake-gpu\nhelm repo update\n```\n2. Deploy the fake GPU to your Kubernetes cluster.\n``` shell\nhelm install fake-gpu fake-gpu-charts/fake-gpu -n kube-system\n```\n3. Configure your application to use the GPU.\n``` shell \ncat \u003c\u003cEOF | kubectl apply -f -\napiVersion: v1\nkind: Pod\nmetadata:\n  name: fake-gpu\nspec:\n  containers:\n  - name: fake-gpu\n    image: nginx\n    resources:\n      limits:\n        nvidia.com/gpu: 1\nEOF\n```\n4. Run your application as you would with a real GPU.\n``` shell\nkubectl exec -it fake-gpu -- nvidia-smi\n+---------------------------------------------------------------------------------------+\n| NVIDIA-SMI 470.129.06           Driver Version: 440.33.01          CUDA Version: 12.2 |\n+-----------------------------------------+----------------------+----------------------+\n| GPU  Name        Persistence-M          | Bus-Id        Disp.A | Volatile Uncorr. ECC |\n| Fan  Temp  Perf  Pwr:Usage/Cap          |         Memory-Usage | GPU-Util  Compute M. |\n|                                         |                      |               MIG M. |\n+-----------------------------------------+----------------------+----------------------+\n|   1  NVIDIA Tesla P4                Off |                  Off |                  Off |\n| N/A   33C    P8    11W /  70W           |   3200MiB / 15411MiB |       0%     Default |\n|                                         |                      |                  N/A |\n+-----------------------------------------+----------------------+----------------------+\n\n+---------------------------------------------------------------------------------------+\n| Processes:                                                                            |\n|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |\n|        ID   ID                                                             Usage      |\n+---------------------------------------------------------------------------------------+\n|    1   N/A  N/A       19       G   /usr/local/nginx                           3200MiB |\n+---------------------------------------------------------------------------------------+\n```\n\n\n## Compilation\n\nTo compile the project, follow these steps:\n\n``` shell\nmake docker-build IMAGE_VERSION=v0.2.0\nhelm template charts/fake-gpu --set imag.repository=chaunceyjiang/fake-gpu  --set image.tag=v0.2.0 --set nri.runtime.patchConfig=false \u003e install.yaml\nkubectl apply -f install.yaml\n```\n\n## Contributing\n\nWe welcome contributions to the `fake-gpu` project. To contribute, follow these guidelines:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bugfix.\n3. Make your changes and commit them with descriptive commit messages.\n4. Push your changes to your forked repository.\n5. Create a pull request to the main repository.\n\nPlease ensure your code follows the project's coding standards and includes appropriate tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaunceyjiang%2Ffake-gpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaunceyjiang%2Ffake-gpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaunceyjiang%2Ffake-gpu/lists"}