{"id":19416804,"url":"https://github.com/davidalgis/godot_cuda","last_synced_at":"2026-05-03T11:33:10.675Z","repository":{"id":261257776,"uuid":"881499305","full_name":"davidAlgis/godot_cuda","owner":"davidAlgis","description":"Demonstration that it is possible to use CUDA directly from Godot engine.","archived":false,"fork":false,"pushed_at":"2024-11-06T11:08:39.000Z","size":272,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T03:31:04.762Z","etag":null,"topics":["cuda","godot","modules"],"latest_commit_sha":null,"homepage":"","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/davidAlgis.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":"2024-10-31T17:37:25.000Z","updated_at":"2024-11-10T21:22:39.000Z","dependencies_parsed_at":"2024-11-05T15:47:43.927Z","dependency_job_id":"127f390a-dbe4-4558-864b-d458dadcd950","html_url":"https://github.com/davidAlgis/godot_cuda","commit_stats":null,"previous_names":["davidalgis/godot_cuda"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidAlgis/godot_cuda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidAlgis%2Fgodot_cuda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidAlgis%2Fgodot_cuda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidAlgis%2Fgodot_cuda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidAlgis%2Fgodot_cuda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidAlgis","download_url":"https://codeload.github.com/davidAlgis/godot_cuda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidAlgis%2Fgodot_cuda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32567349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","godot","modules"],"created_at":"2024-11-10T13:05:27.740Z","updated_at":"2026-05-03T11:33:10.657Z","avatar_url":"https://github.com/davidAlgis.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GodotCUDA\n\nThis project demonstrate that it's possible to use [CUDA](https://developer.nvidia.com/cuda-toolkit) directly in Godot. \n\nThis demonstration is based on these two documentation page : [Custom modules in c++](https://docs.godotengine.org/en/latest/contributing/development/core_and_modules/custom_modules_in_cpp.html) and [Binding to external libraries](https://docs.godotengine.org/en/stable/contributing/development/core_and_modules/binding_to_external_libraries.html).\n\nBriefly, I made a C++ module which is my entry point from a custom Godot engine to a simple CUDA library that is in `cuda_test_library` folder. \n\n\n## Warning \n\nI'm not an expert in Godot or SConstruct, so the method used here to integrate CUDA might not be the most efficient. The code and demonstration are quite rough and were only created to prove that CUDA can be used in Godot. If you plan to use this in a real application, I recommend cleaning up the code and procedure.\n\nFinally, this project has been test only on windows 11 and Godot 4.4.\n\n# Installation\n\nHere are the step to follows, to make this module works:\n\n1. Retrieve the source code of [Godot](https://github.com/godotengine/godot.git)\n\n2. Create a folder named `godot_cuda` in the folder `modules\\` of Godot sources.\n\n3. Copy the content of this repository in the new folder `modules\\godot_cuda`\n\n4. Adapt `SCsub` file in `modules\\godot_cuda`. I didn't succeed to make it works with relative path, therefore you need to put your path to the folder `cuda_test_library` of this module on this line: \n```py\nenv.Append(LIBPATH=['your_path_to_cuda_test_library/cuda_test_library'])\n```\n\n5. [Optional] I versioned the binary file of my simple cuda library, but you can generate and compile them manually with [CMake](https://cmake.org/), using these commands lines:\n```bash\ncmake -B build\ncmake --build build --config release\n``` \nIt's a very simple and \"artificial\" library that only have one function that multiply by 2.5 with CUDA a given int. But you can replace it by any CUDA calculation.\n\n6. Copy `cudart.lib` (which is normally located in `C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.3\\lib\\x64`) to `cuda_test_library` folder, to make SCons find it. I didn't succeed to make it find directly the library in `CUDA_PATH`.\n\n7. Install SCons the tools for Godot construction, using one of this command line (ensure you have [python](https://www.python.org) and pip in your path first):\n```bash\npip install -r \"requirements.txt\" //this command should be launch from godot_cuda folder\npip install scons\n```\n8. Execute SCons from Godot source folder, by calling this single line:\n```bash\nscons\n```\nIt might takes a while (~45 min) for the first execution (it's reconstructing the whole engine in addition of our simple module).\n\n9. Once it has finish, copy `cuda_plugin.dll` located in `cuda_test_library/` to the `bin/` folder of Godot source.\n\n10. In the same way, copy the cuda main library `cudart64_12.dll` (which is by default on windows located at `C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.3\\bin`) to the `bin/` folder of Godot source. (I didn't succeed to make Godot locate this two library from path, they had to be right next the Godot executable)\n\n11. Open the Godot executable located in `bin/` folder.\n\n12. Create a new project.\n\n13. Add a scene in the project with this script:\n```py\nextends Node3D\n\nfunc _ready():\n    var s = GodotCUDA.new()\n    # simply performs a multiplication by 2.5 from 10\n    s.cuda_calculation(10)\n    # should print 25\n    print(s.get_total())\n```\n\n14. Execute the scene, it should print `25`. \n\nCongratulation Godot is running a CUDA function !\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidalgis%2Fgodot_cuda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidalgis%2Fgodot_cuda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidalgis%2Fgodot_cuda/lists"}