{"id":13645112,"url":"https://github.com/GPUOpen-LibrariesAndSDKs/Orochi","last_synced_at":"2025-04-21T13:31:47.478Z","repository":{"id":38196165,"uuid":"455620901","full_name":"GPUOpen-LibrariesAndSDKs/Orochi","owner":"GPUOpen-LibrariesAndSDKs","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-20T20:30:14.000Z","size":152876,"stargazers_count":220,"open_issues_count":12,"forks_count":34,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-20T21:26:38.991Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/GPUOpen-LibrariesAndSDKs.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,"zenodo":null}},"created_at":"2022-02-04T16:37:09.000Z","updated_at":"2025-04-02T15:18:34.000Z","dependencies_parsed_at":"2023-02-10T17:15:35.492Z","dependency_job_id":"74df5b8a-7ee8-428f-939b-95f2e7d230dd","html_url":"https://github.com/GPUOpen-LibrariesAndSDKs/Orochi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2FOrochi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2FOrochi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2FOrochi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2FOrochi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GPUOpen-LibrariesAndSDKs","download_url":"https://codeload.github.com/GPUOpen-LibrariesAndSDKs/Orochi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250064682,"owners_count":21368948,"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":[],"created_at":"2024-08-02T01:02:27.504Z","updated_at":"2025-04-21T13:31:46.173Z","avatar_url":"https://github.com/GPUOpen-LibrariesAndSDKs.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"## About\n\n\"Yamata No Orochi\"\u003csup\u003e[1]\u003c/sup\u003e \n\nOrochi is a library loading HIP and CUDA APIs dynamically, allowing the user to switch APIs at runtime. Therefore you don't need to compile two separate implementations for each API. This allows you to compile and maintain a single binary that can run on both AMD and NVIDIA GPUs. Unlike HIP, which uses hipamd or CUDA at compile-time, Orochi will dynamically load the corresponding HIP/CUDA shared libraries depending on your platform. In other words, it combines the functionality offered by HIPEW and CUEW into a single library.\n\n\n```mermaid\ngraph LR\n    A(User code using \u003cbr/\u003e driver API) --\u003e B(Orochi)\n    B --\u003e |AMD GPU|C(HIP \u003cbr/\u003e amdhip64.dll)\n    B --\u003e |NVIDIA GPU| D(CUDA \u003cbr/\u003e nvcuda.dll)\n```\n\n---\n\n## Requirement\n\nIn order to enable the CUDA backend you need to:\n * Have the CUDA SDK installed ( only the header folder is used by Orochi, at compile-time )\n * Add the CUDA include folder to the Include Directories list of your project.\n * Add the define `OROCHI_ENABLE_CUEW` to your project\n\nFor the HIP backend: it's easier as everything needed is embedded in this project, thus you don't need to do anything.\n\nThis library doesn't require you to link to CUDA nor HIP at build-time. This provides the benefit that the runtime works even if one of the two drivers, either CUDA or HIP, is installed.\n\nTo run an application compiled with Orochi, you need to install a driver of your choice with the corresponding .dll/.so files based on the GPU(s) available. Orochi will automatically link with the corresponding shared library at runtime.\n\n---\n\n## SDK multiple versions support\n\nOrochi will aim to maintain support for various version combinations, enabling developers to switch between branches depending on their environment.\n\nCombinations currently supported:\n| HIP version | CUDA version | Branch                                                                                                     | Remarks |\n|-------------|--------------|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|\n| 5.7         | 12.2         | [release/hip5.7_cuda12.2](https://github.com/GPUOpen-LibrariesAndSDKs/Orochi/tree/release/hip5.7_cuda12.2) | - Tested and validated.\u003cbr\u003e - Synchronized with the `main` branch.\u003cbr\u003e - Use this one for compatibility with a wider range of machines. |\n| 6.0         | 12.2         | [release/hip6.0_cuda12.2](https://github.com/GPUOpen-LibrariesAndSDKs/Orochi/tree/release/hip6.0_cuda12.2) | - Tested and validated.\u003cbr\u003e - HIP Windows DLLs not provided yet.\u003cbr\u003e - Use this one to take advantage of the latest HIP features and if you are on machine with HIP 6 driver. |\n\nIf you need a combination that is currently not supported, open an [Issue](https://github.com/GPUOpen-LibrariesAndSDKs/Orochi/issues).\n\n----\n\n## API example \n\nAPIs have prefix `oro`. If you are familiar with CUDA or HIP driver APIs, you will get used to Orochi APIs easily.  \n\nFor example, suppose we have the following HIP code for device and context creation:\n\n```\n#include \u003chip/hip_runtime.h\u003e\n\nhipInit( 0 );\nhipDevice device;\nhipDeviceGet( \u0026device, 0 );\nhipCtx ctx;\nhipCtxCreate( \u0026ctx, 0, device );\n\n```\n\n\nThe same code can be rewritten using Orochi as:\n\n\n```\n#include \u003cOrochi/Orochi.h\u003e\n\noroInitialize( ORO_API_HIP, 0 );\noroInit( 0 );\noroDevice device;\noroDeviceGet( \u0026device, 0 );\noroCtx ctx;\noroCtxCreate( \u0026ctx, 0, device );\n```\nWhich will run on both CUDA and HIP at runtime!\n\nSee more in the [sample application](./Test/main.cpp).\n\n----\n\n## Building Sample Application\n\nRun premake. \n\n```\n./tools/premake5/win/premake5.exe vs2022\n```\nNote: add the option `--precompiled` to enable precompiled bitcode\n\nTest is a minimum application.\n\n### Test Applications\n\nThe test applications run on HIP by default. If you want to run on CUDA, run the app with an arg `cuda`. \n\nThe source code for the test applications can be found [here](./Test/).\n\n----\n\n## Contribution\n\nFeel free to open pull requests.\n\nYou can either target a specific `release/` branch or the `main` branch.\n\nIf it makes sense, your commit will then be propagated in the different `release/` branches by us.\n\n----\n\n[1] Yamata no Orochi (ヤマタノオロチ, 八岐大蛇) is a legendary eight-headed and eight-tailed Japanese dragon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGPUOpen-LibrariesAndSDKs%2FOrochi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGPUOpen-LibrariesAndSDKs%2FOrochi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGPUOpen-LibrariesAndSDKs%2FOrochi/lists"}