{"id":15042395,"url":"https://github.com/phohenecker/switch-cuda","last_synced_at":"2025-04-05T10:08:13.954Z","repository":{"id":38705860,"uuid":"133541528","full_name":"phohenecker/switch-cuda","owner":"phohenecker","description":"A simple bash script for switching between installed versions of CUDA.","archived":false,"fork":false,"pushed_at":"2018-12-19T07:36:10.000Z","size":4,"stargazers_count":623,"open_issues_count":3,"forks_count":142,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T09:08:57.607Z","etag":null,"topics":["bash-script","cuda-toolkit"],"latest_commit_sha":null,"homepage":null,"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/phohenecker.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}},"created_at":"2018-05-15T16:08:39.000Z","updated_at":"2025-03-20T12:29:41.000Z","dependencies_parsed_at":"2022-07-14T22:16:59.089Z","dependency_job_id":null,"html_url":"https://github.com/phohenecker/switch-cuda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phohenecker%2Fswitch-cuda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phohenecker%2Fswitch-cuda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phohenecker%2Fswitch-cuda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phohenecker%2Fswitch-cuda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phohenecker","download_url":"https://codeload.github.com/phohenecker/switch-cuda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"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":["bash-script","cuda-toolkit"],"created_at":"2024-09-24T20:47:13.912Z","updated_at":"2025-04-05T10:08:13.929Z","avatar_url":"https://github.com/phohenecker.png","language":"Shell","readme":"switch-cuda\n===========\n\nSometimes, it becomes necessary to switch to an earlier version of CUDA in order to run older code on a machine that is\nactually set up to use the current version of the CUDA toolkit.\nThis is as simple as adjusting the values of a few environment variables, yet it is cumbersome to do manually.\nTherefore, this repository provides the bash script [`switch-cuda.sh`](switch-cuda.sh), which adjusts the environment to\nuse a specific version of CUDA **for the current bash session**.\n\n**Notice:** [`switch-cuda.sh`](switch-cuda.sh) has been written for and tested on Ubuntu 16.04, but is easily adapted\nfor other platforms.\n\n\nUsage\n-----\n\n```\nsource switch-cuda.sh [VERSION]\n```\n\nNotice that the script has to be sourced rather than executed, as it performs changes of environment variables that are\nsupposed to persist after the script has finished.\nIf a version number is provided, than all relevant environment variables are adjusted to the required CUDA version\n(including `PATH`, `LD_LIBRARY_PATH`, `CUDA_HOME`, and `CUDA_ROOT`).\nIf no version is provided, however, then the script simply prints all versions of CUDA that have been found on the used\nmachine (in `/usr/local`).\n\n\nExamples\n--------\n\n```\n$ source switch-cuda.sh \nThe following CUDA installations have been found (in '/usr/local'):\n* cuda-8.0\n* cuda-9.0\n* cuda-9.1\n```\n\n```\n$ source switch-cuda.sh 9.0\nSwitched to CUDA 9.0.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphohenecker%2Fswitch-cuda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphohenecker%2Fswitch-cuda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphohenecker%2Fswitch-cuda/lists"}