{"id":15381587,"url":"https://github.com/alessandrobessi/cuda-lab","last_synced_at":"2025-04-15T19:16:50.507Z","repository":{"id":91092583,"uuid":"165992124","full_name":"alessandrobessi/cuda-lab","owner":"alessandrobessi","description":"Playing with CUDA and GPUs in Google Colab","archived":false,"fork":false,"pushed_at":"2019-01-18T09:42:56.000Z","size":36,"stargazers_count":9,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T19:16:43.052Z","etag":null,"topics":["cuda","cuda-kernels","gpu","gpu-acceleration","gpu-programming","parallel-algorithm","parallel-computing"],"latest_commit_sha":null,"homepage":"","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alessandrobessi.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":"2019-01-16T07:08:42.000Z","updated_at":"2023-05-25T10:56:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"75172f5e-0579-4493-bfef-72f83f4c7b85","html_url":"https://github.com/alessandrobessi/cuda-lab","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":"0.17647058823529416","last_synced_commit":"416cf1cc62b856ee342f409b7ba01f83ae44a5f0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alessandrobessi%2Fcuda-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alessandrobessi%2Fcuda-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alessandrobessi%2Fcuda-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alessandrobessi%2Fcuda-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alessandrobessi","download_url":"https://codeload.github.com/alessandrobessi/cuda-lab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135831,"owners_count":21218365,"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":["cuda","cuda-kernels","gpu","gpu-acceleration","gpu-programming","parallel-algorithm","parallel-computing"],"created_at":"2024-10-01T14:28:06.159Z","updated_at":"2025-04-15T19:16:50.501Z","avatar_url":"https://github.com/alessandrobessi.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cuda-lab\nPlaying with CUDA and GPUs in Google Colab.\n\n## Usage\n1. Open a Colab notebook: https://colab.research.google.com/\n2. Create a new Python 3 notebook\n3. Change runtime type selecting GPU as hardware accelerator\n4. Git clone this repository:\n```\n!git clone https://github.com/alessandrobessi/cuda-lab.git\n```\n5. Change permissions:\n```\n!chmod 755 cuda-lab/INSTALL.sh\n```\n6. Install cuda, nvcc, gcc, and g++:\n```\n!./cuda-lab/INSTALL.sh\n```\n\n7. Add `/usr/local/cuda/bin` to `PATH`:\n```python\nimport os\nos.environ['PATH'] += ':/usr/local/cuda/bin'\n```\n\n8. Compile an existing Cuda source:\n```\n!nvcc cuda-lab/add.cu -o add -Wno-deprecated-gpu-targets\n```\n\n9. Run the compiled Cuda source using the Nvidia profiler tool:\n```\n!nvprof ./add\n```\n\n10. or just time it:\n```\n!time ./add\n```\n\nYou can also create a Cuda source file using the magic command `%%writefile \u003cfilename.cu\u003e`:\n``` \n%%writefile snippet.cu\n#include \u003cstdlib.h\u003e\n#include \u003cstdio.h\u003e\n#include \u003cmath.h\u003e\n...\n```\n\nand then compile and run it!\n```\n!nvcc snippet.cu -o snippet -Wno-deprecated-gpu-targets\n!nvprof ./snippet\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessandrobessi%2Fcuda-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falessandrobessi%2Fcuda-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessandrobessi%2Fcuda-lab/lists"}