{"id":18009134,"url":"https://github.com/kwea123/python-ray-tracing-with-cuda-example","last_synced_at":"2025-03-26T13:31:48.377Z","repository":{"id":37518515,"uuid":"288346621","full_name":"kwea123/python-ray-tracing-with-cuda-example","owner":"kwea123","description":"An example of cuda ray tracing in pure python syntax.","archived":false,"fork":false,"pushed_at":"2020-09-07T07:14:02.000Z","size":21409,"stargazers_count":35,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T22:22:00.701Z","etag":null,"topics":["cuda","numba","python","ray-tracing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kwea123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-18T03:38:05.000Z","updated_at":"2024-09-24T08:36:56.000Z","dependencies_parsed_at":"2022-08-19T18:50:46.610Z","dependency_job_id":null,"html_url":"https://github.com/kwea123/python-ray-tracing-with-cuda-example","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/kwea123%2Fpython-ray-tracing-with-cuda-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwea123%2Fpython-ray-tracing-with-cuda-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwea123%2Fpython-ray-tracing-with-cuda-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwea123%2Fpython-ray-tracing-with-cuda-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwea123","download_url":"https://codeload.github.com/kwea123/python-ray-tracing-with-cuda-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245662929,"owners_count":20652100,"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","numba","python","ray-tracing"],"created_at":"2024-10-30T02:08:48.417Z","updated_at":"2025-03-26T13:31:47.030Z","avatar_url":"https://github.com/kwea123.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-ray-tracing-with-cuda-example\nAn example of cuda ray tracing in pure python syntax. It reproduces the result of [Ray Tracing in One Weekend](https://raytracing.github.io/books/RayTracingInOneWeekend.html)\n\nThe original cpp code takes around 4 hours to complete, while this python CUDA implementation takes less than 1 minute.\n\n**NOTE**: The code is not guaranteed to be fully optimized, but I intend to provide some insights on efficient python ray tracing implementation.\n\n**ATTENTION**: Currently it consumes ~16G of memory, so be aware if your PC doesn't have enough memory. You can decrease `SAMPLES_PER_RAY` to reduce memory consumption.\n\n![test](test.png)\n\n```\nscene has 485 objs, takes 0.0107 s to construct\nrendering time: 47.7054 s\nsaving to test.png ...\n```\n\n# Installation\n\n## Requirements\n\nUbuntu with NVIDIA GPU (tested on RTX 2080Ti)\n\n```\nconda install numba matplotlib\n```\n\n## Run\n\n```\npython demo.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwea123%2Fpython-ray-tracing-with-cuda-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwea123%2Fpython-ray-tracing-with-cuda-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwea123%2Fpython-ray-tracing-with-cuda-example/lists"}