{"id":25614379,"url":"https://github.com/manu-sh/cuda-mandelbrot","last_synced_at":"2026-04-15T12:35:24.319Z","repository":{"id":278666000,"uuid":"935605107","full_name":"Manu-sh/cuda-mandelbrot","owner":"Manu-sh","description":"how to use cuda acceleration to compute mandelbrot set","archived":false,"fork":false,"pushed_at":"2025-02-21T02:16:52.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T02:35:14.824Z","etag":null,"topics":["cuda","mandelbrot","ppm-image"],"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/Manu-sh.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":"2025-02-19T18:04:04.000Z","updated_at":"2025-02-21T02:16:56.000Z","dependencies_parsed_at":"2025-02-21T02:35:16.450Z","dependency_job_id":"c16a7d9d-76d5-432b-8584-31edc666a38a","html_url":"https://github.com/Manu-sh/cuda-mandelbrot","commit_stats":null,"previous_names":["manu-sh/cuda-mandelbrot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manu-sh%2Fcuda-mandelbrot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manu-sh%2Fcuda-mandelbrot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manu-sh%2Fcuda-mandelbrot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manu-sh%2Fcuda-mandelbrot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Manu-sh","download_url":"https://codeload.github.com/Manu-sh/cuda-mandelbrot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240114340,"owners_count":19749838,"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","mandelbrot","ppm-image"],"created_at":"2025-02-22T02:19:04.191Z","updated_at":"2026-04-15T12:35:24.308Z","avatar_url":"https://github.com/Manu-sh.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Cuda Mandelbrot 🔀\n###### how to use cuda acceleration to compute mandelbrot set\n\nThe code is written for my ___rtx 4070s___ so there is no guarantee it will work on others gpus\nbut it probably will work on every rtx 4000, ~~i will take a closer look at portability in the future~~\n\nyou can select your architecture passing the `-DCMAKE_CUDA_ARCHITECTURES=XX` flag where `XX`\nis [your cuda architecture](https://developer.nvidia.com/cuda-gpus). \n\n\n| GPU Series         | Compute Capability |\n|--------------------|-------------------|\n| RTX 40xx (Ada)     | 89                |\n| RTX 30xx (Ampere)  | 86                |\n| RTX 20xx (Turing)  | 75                |\n| GTX 16xx (Turing)  | 75                |\n| GTX 10xx (Pascal)  | 61, 62            |\n| GTX 900 (Maxwell)  | 50, 52            |\n\notherwise you can use `nvcc -ls-arch` to get a detailed list \n\n\n```bash\nmkdir -p build \u0026\u0026 cd build\n\ncmake                         \\ \n-DCMAKE_BUILD_TYPE=Release    \\\n-DCMAKE_CUDA_ARCHITECTURES=89 \\\n..\n\nmake -j`nproc --all`\n./cuda\nfeh test.ppm\n```\n\nLearning resources\n\n- https://developer.nvidia.com/blog/cuda-pro-tip-write-flexible-kernels-grid-stride-loops/\n- https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#thread-hierarchy\n- https://codingbyexample.com/2018/12/17/cuda-threads-memory/\n- https://www.youtube.com/playlist?list=PLC6u37oFvF40BAm7gwVP7uDdzmW83yHPe\n- https://cuda-tutorial.readthedocs.io/en/latest/\n- https://tschmidt23.github.io/cse599i/CSE%20599%20I%20Accelerated%20Computing%20-%20Programming%20GPUs%20Lecture%2017.pdf\n\n\nprofiling, nvprof is a sort of compatibility layer to use old nvprof syntax, \nbut most of nvprof flags are simply ignored by nsys\n\ngpu profiling\n```\nnsys --help profile\nnsys --help nvprof\n\n# es.\nnsys profile -o report.qdrep ./cuda \nnsys nvprof ./cuda \nnsys profile --stats=true ./cuda\nnsys nvprof --print-gpu-trace ./cuda \n```\n\ncpu profiling\n```sh\nperf stat -e task-clock,cycles,instructions,r1b1,r10e,stalled-cycles-frontend,stalled-cycles-backend,L1-dcache-load-misses,cache-misses ./cuda\nperf stat -r 10 valgrind --tool=callgrind ./cuda\nvalgrind --tool=callgrind ./cuda\nvalgrind --tool=callgrind ./cuda | kcachegrind\n```\n\ndynamic analysis\n```\nvalgrind --undef-value-errors=no --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes ./cuda\n```\n\nasm\n```sh\nobjdump -S -M intel cuda | gedit - \u0026\n```\n\n###### Copyright © 2025, [Manu-sh](https://github.com/Manu-sh), s3gmentationfault@gmail.com. Released under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanu-sh%2Fcuda-mandelbrot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanu-sh%2Fcuda-mandelbrot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanu-sh%2Fcuda-mandelbrot/lists"}