{"id":16935759,"url":"https://github.com/alextmjugador/rust-cuda-quickstart","last_synced_at":"2026-05-06T19:05:40.315Z","repository":{"id":178024699,"uuid":"661261699","full_name":"AlexTMjugador/Rust-CUDA-quickstart","owner":"AlexTMjugador","description":"Bring the Rust-CUDA project back to life under modern Linux environments.","archived":false,"fork":false,"pushed_at":"2023-07-02T10:27:59.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T05:13:08.448Z","etag":null,"topics":["cuda","cuda-programming","cuda-rust","cuda-support","docker","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/AlexTMjugador.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":"2023-07-02T09:47:25.000Z","updated_at":"2024-03-25T15:55:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"9351ddbb-c563-4921-b379-a974c1999bf7","html_url":"https://github.com/AlexTMjugador/Rust-CUDA-quickstart","commit_stats":null,"previous_names":["alextmjugador/rust-cuda-quickstart"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/AlexTMjugador/Rust-CUDA-quickstart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexTMjugador%2FRust-CUDA-quickstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexTMjugador%2FRust-CUDA-quickstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexTMjugador%2FRust-CUDA-quickstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexTMjugador%2FRust-CUDA-quickstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexTMjugador","download_url":"https://codeload.github.com/AlexTMjugador/Rust-CUDA-quickstart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexTMjugador%2FRust-CUDA-quickstart/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259602551,"owners_count":22883007,"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-programming","cuda-rust","cuda-support","docker","rust"],"created_at":"2024-10-13T20:55:17.925Z","updated_at":"2026-05-06T19:05:40.216Z","avatar_url":"https://github.com/AlexTMjugador.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eRust-CUDA quickstart\u003c/h1\u003e\n\n\u003ci\u003eBring the \u003ca href=\"https://github.com/Rust-GPU/Rust-CUDA\"\u003eRust-CUDA\u003c/a\u003e\nproject back to life under modern Linux environments.\u003c/i\u003e\n\n\u003c/div\u003e\n\n# 💡 Background\n\n`rustc` has an official [Tier 2\n`nvptx64-nvidia-cuda`](https://doc.rust-lang.org/rustc/platform-support.html#tier-2)\ntarget that leverages the corresponding [LLVM\nbackend](https://llvm.org/docs/NVPTXUsage.html) to generate portable PTX\nassembly that can be translated to GPU-specific machine code by the CUDA driver\nat runtime.\n\nBut there are several pitfalls with the idea of running CUDA kernels by\nsimply telling `rustc` to build for `nvptx64-nvidia-cuda`:\n\n- LLVM's PTX code generation [is said to be\n  buggy](https://rust-gpu.github.io/Rust-CUDA/faq.html#why-not-use-rustc-with-the-llvm-ptx-backend),\n  sometimes producing completely invalid code.\n- Generating PTX code is only part of the story: the built kernels must somehow\n  be loaded and executed on the GPU. This task requires Rust bindings to parts\n  of the CUDA API.\n\nThe amazing [Rust-CUDA](https://github.com/Rust-GPU/Rust-CUDA) project addresses\nthese pitfalls by introducing a custom `rustc` target that uses NVVM, NVIDIA's\nproprietary PTX code generation backend included with the CUDA SDK, and offering\na set of crates with ergonomic Rust APIs for CUDA kernel development.\n\nHowever, Rust-CUDA has been unmaintained for more than two years at the time of\nthis writing, and there is no indication of that changing soon. This is a great\nproblem, because Rust-CUDA is coupled with specific CUDA and nightly Rust\nversions that date back to 2021 and are starting to show their age in the form\nof increased incompatibilities with updated execution environments. Currently,\nit's not possible to use Rust-CUDA as-is because it depends on an outdated major\nCUDA version and most of the Rust ecosystem is pushing towards higher Rust\nversion requirements.\n\nSeveral users have submitted pull requests to Rust-CUDA to update the versions\nit's coupled to, but these update attempts have caused code generation\nregressions that are seemingly difficult to pinpoint and fix.\n\n# ✨ Purpose\n\nAs an easier and less risky solution to updating Rust-CUDA, this repository\ndefines a quickstart project and a controlled Docker environment capable of\nexecuting Rust-CUDA as it was possible years ago. This is achieved by:\n\n- Defining a Docker container with the latest supported CUDA and Ubuntu\n  userspace component versions, so that the Rust-CUDA system dependencies work\n  with the versions they were meant to work with, even if the host system is\n  much more up-to-date.\n- Carefully selecting Rust dependency versions, so that no crate in the\n  dependency graph has an MSRV greater than `nightly-2021-12-04`.\n- Patching Rust dependencies as needed to get them to build and work on more\n  environments.\n\n# 🔨 Usage\n\nFirst off, remember to check out the submodules containing vendor code (`git\nsubmodule update --init --recursive`). After that, execute `run.sh`, and if\neverything goes fine you'll eventually find yourself at a shell where you can\nexecute `cargo run --release` to build and launch a CUDA kernel.\n\nYour Docker installation must be set up to use the NVIDIA Container Toolkit, as\notherwise CUDA won't work in Docker containers.\n\nWhen changing Cargo dependencies, remember to run `pin-deps.sh` to ensure that\nthe `Cargo.lock` file is not updated with too new crates. It may be necessary to\nupdate that file as dependencies are modified.\n\nThe Rust side of this project is very similar to the simple add Rust-CUDA\nexample. A few bits of code have been copied from it.\n\nIn its current state, this repository will only work on Linux-like environments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextmjugador%2Frust-cuda-quickstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextmjugador%2Frust-cuda-quickstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextmjugador%2Frust-cuda-quickstart/lists"}