# GPU Programming

**URL:** https://forum.modular.com/c/gpu-programming/24.md

[Latest](https://forum.modular.com/latest.md) · [Categories](https://forum.modular.com/categories.md) · [Tags](https://forum.modular.com/tags.md)

---

## [About the GPU Programming category](https://forum.modular.com/t/about-the-gpu-programming-category/770)

<div class="topic-metadata">

**Author:** [@Caroline](https://forum.modular.com/u/Caroline)\
**Replies:** 0

</div>

---

## [GPU programming only with Max?](https://forum.modular.com/t/gpu-programming-only-with-max/3495)

<div class="topic-metadata">

**Author:** [@Fil](https://forum.modular.com/u/Fil)\
**Replies:** 1\
**Last updated:** [September 14, 2026, 8:59pm UTC](https://forum.modular.com/t/gpu-programming-only-with-max/3495 "2026-09-14T20:59:39Z")

</div>

Good evening (CET time:-)). I saw that in the last mojo nightly builds it is written that the std.gpu module will be replaced by max.gpu module? Does that mean that it won’t be possible to write GPU code without Max? Wi…

---

## [Idiomatic double buffering in a Mojo matmul inner loop? (sm\_86, 80-92% of hand-written CUDA)](https://forum.modular.com/t/idiomatic-double-buffering-in-a-mojo-matmul-inner-loop-sm-86-80-92-of-hand-written-cuda/3437)

<div class="topic-metadata">

**Author:** [@Cro22](https://forum.modular.com/u/Cro22)\
**Replies:** 0\
**Last updated:** [August 25, 2026, 2:10pm UTC](https://forum.modular.com/t/idiomatic-double-buffering-in-a-mojo-matmul-inner-loop-sm-86-80-92-of-hand-written-cuda/3437 "2026-08-25T14:10:59Z")

</div>

Owen suggested I bring this over from Discord. Setup: RTX 3090 (GA102, sm\_86), Mojo 1.0 / MAX 26.5, clocks pinned at 1695 MHz, median of 30 samples with IQR. Three kernels written twice, once in CUDA and once in Mojo, s…

---

## [Calling all AMD RDNA users: help us bring full MAX support to your GPUs!](https://forum.modular.com/t/calling-all-amd-rdna-users-help-us-bring-full-max-support-to-your-gpus/2015)

<div class="topic-metadata">

**Author:** [@BradLarson](https://forum.modular.com/u/BradLarson)\
**Replies:** 18\
**Last updated:** [July 28, 2026, 7:26pm UTC](https://forum.modular.com/t/calling-all-amd-rdna-users-help-us-bring-full-max-support-to-your-gpus/2015 "2026-07-28T19:26:32Z")

</div>

Hi everyone :waving\_hand: You might remember that with our 25.4 release, we officially brought full support for AMD’s powerful data center GPUs (MI300X and MI325X) to our MAX and Mojo platforms. These CDNA3-based GPUs a…

---

## [What is the targetted demographic for Mojo/MAX?](https://forum.modular.com/t/what-is-the-targetted-demographic-for-mojo-max/3343)

<div class="topic-metadata">

**Author:** [@Curious](https://forum.modular.com/u/Curious)\
**Replies:** 2\
**Last updated:** [July 25, 2026, 6:22pm UTC](https://forum.modular.com/t/what-is-the-targetted-demographic-for-mojo-max/3343 "2026-07-25T18:22:24Z")

</div>

Now that we are a Qualcomm community sort of speak, would issues like the one below (sm\_90 segfault), be more likely to be prioritized, less so or about the same? Stated in another way, is Modular’s focus shifting away …

---

## [Lowering to Loom IR for AMDGPU codegen](https://forum.modular.com/t/lowering-to-loom-ir-for-amdgpu-codegen/3285)

<div class="topic-metadata">

**Author:** [@bwibking](https://forum.modular.com/u/bwibking)\
**Replies:** 0\
**Last updated:** [June 28, 2026, 5:36pm UTC](https://forum.modular.com/t/lowering-to-loom-ir-for-amdgpu-codegen/3285 "2026-06-28T17:36:33Z")

</div>

I am interesting to know whether it will be possible to extend the Mojo compiler to lower to Loom IR instead of LLVM IR → AMDGPU assembly. The AMDGPU backend in upstream LLVM has historically had, let’s say, some issues…

---

## [Programming the Steam Deck's GPU with Mojo and MAX](https://forum.modular.com/t/programming-the-steam-decks-gpu-with-mojo-and-max/3282)

<div class="topic-metadata">

**Author:** [@BradLarson](https://forum.modular.com/u/BradLarson)\
**Replies:** 1\
**Last updated:** [June 27, 2026, 6:17pm UTC](https://forum.modular.com/t/programming-the-steam-decks-gpu-with-mojo-and-max/3282 "2026-06-27T18:17:38Z")

</div>

This morning’s nightly release has a fun addition: the ability to program the Steam Deck’s GPU using Mojo and MAX! SteamOS 3.8 upgraded the version of the AMD HIP driver to one that was new enough to be used with Moj…

---

## [Learning about GPU programming in a browser](https://forum.modular.com/t/learning-about-gpu-programming-in-a-browser/3122)

<div class="topic-metadata">

**Author:** [@jbemmel](https://forum.modular.com/u/jbemmel)\
**Replies:** 1\
**Last updated:** [June 9, 2026, 3:41pm UTC](https://forum.modular.com/t/learning-about-gpu-programming-in-a-browser/3122 "2026-06-09T15:41:45Z")

</div>

I came across https://www.tensortonic.com/ and I thought it might be of interest. Something like that with Mojo could be really helpful , imho

---

## [How to distribute data into blocks?](https://forum.modular.com/t/how-to-distribute-data-into-blocks/3131)

<div class="topic-metadata">

**Author:** [@sashang](https://forum.modular.com/u/sashang)\
**Replies:** 1\
**Last updated:** [June 1, 2026, 4:50pm UTC](https://forum.modular.com/t/how-to-distribute-data-into-blocks/3131 "2026-06-01T16:50:08Z")

</div>

Hello I was going through the gpu puzzles and got p06 where the input array is split between multiple thread blocks. It looks like it fills each thread block up with data from the input array before going to the next t…

---

## [Puzzle 32 shared memory data race](https://forum.modular.com/t/puzzle-32-shared-memory-data-race/3063)

<div class="topic-metadata">

**Author:** [@BeastBritish](https://forum.modular.com/u/BeastBritish)\
**Replies:** 1\
**Last updated:** [May 12, 2026, 7:50pm UTC](https://forum.modular.com/t/puzzle-32-shared-memory-data-race/3063 "2026-05-12T19:50:35Z")

</div>

In Puzzle 32: Bank Conflicts, the two-way conflict kernel doesn’t always pass the test: $ mojo problems/p32/p32.mojo --test Testing bank conflict kernels... No-conflict kernel test: passed Two-way conflict kernel test: …

---

## [How to use DeviceContext](https://forum.modular.com/t/how-to-use-devicecontext/2991)

<div class="topic-metadata">

**Author:** [@ratulb](https://forum.modular.com/u/ratulb)\
**Replies:** 7\
**Last updated:** [April 23, 2026, 12:50pm UTC](https://forum.modular.com/t/how-to-use-devicecontext/2991 "2026-04-23T12:50:59Z")

</div>

If DeviceContext is used in multiple places, is it better to wrap it in ArcPointer and use it via the pointer? For example: var device\_ctx1 = DeviceContext() var device\_ctx2 = DeviceContext() # Should we d…

---

## [Is there a way to make numpy access gpu memory?](https://forum.modular.com/t/is-there-a-way-to-make-numpy-access-gpu-memory/2949)

<div class="topic-metadata">

**Author:** [@init\_bug](https://forum.modular.com/u/init_bug)\
**Replies:** 1\
**Last updated:** [April 9, 2026, 12:41am UTC](https://forum.modular.com/t/is-there-a-way-to-make-numpy-access-gpu-memory/2949 "2026-04-09T00:41:31Z")

</div>

hello guys ! Here is my case: i have a 512\*512 image with def main() raises: with DeviceContext() as ctx: var out\_r\_buf = ctx.enqueue\_create\_buffer\[dtype\](SIZE \* SIZE) var out\_g\_buf = ctx.enqueue\_create\_buffer\[dtype\](…

---

## [Launching Mojo kernels on a specific CUDA/HIP stream?](https://forum.modular.com/t/launching-mojo-kernels-on-a-specific-cuda-hip-stream/2830)

<div class="topic-metadata">

**Author:** [@bwibking](https://forum.modular.com/u/bwibking)\
**Replies:** 1\
**Last updated:** [March 12, 2026, 5:36pm UTC](https://forum.modular.com/t/launching-mojo-kernels-on-a-specific-cuda-hip-stream/2830 "2026-03-12T17:36:46Z")

</div>

Hi, I am writing a set of Mojo bindings for a CUDA/HIP library that expects applications to launch their kernels on a given stream, because the library may launch dependent kernels on the same stream. Is there a way to…

---

## [How to get Mojo to detect AMD integrated GPU (APU)?](https://forum.modular.com/t/how-to-get-mojo-to-detect-amd-integrated-gpu-apu/2727)

<div class="topic-metadata">

**Author:** [@Nav](https://forum.modular.com/u/Nav)\
**Replies:** 16\
**Last updated:** [March 12, 2026, 8:45am UTC](https://forum.modular.com/t/how-to-get-mojo-to-detect-amd-integrated-gpu-apu/2727 "2026-03-12T08:45:38Z")

</div>

I tried the GPU tutorial but running mojo vector\_addition.mojo results in “No compatible GPU found“. I find this odd because I installed the AMD drivers for the GPU that is integrated with the AMD CPU (it’s called an APU…

---

## [Zero-copy DLPack interop](https://forum.modular.com/t/zero-copy-dlpack-interop/2834)

<div class="topic-metadata">

**Author:** [@bwibking](https://forum.modular.com/u/bwibking)\
**Replies:** 1\
**Last updated:** [March 12, 2026, 4:28am UTC](https://forum.modular.com/t/zero-copy-dlpack-interop/2834 "2026-03-12T04:28:02Z")

</div>

I’d like to support zero-copy data exchange for device buffers originally allocated in code written in C++ and Python and passed to Mojo. It looks like the best way to do this is by Mojo supporting the DLPack interop sta…

---

## [Apple Silicon GPU support in Mojo](https://forum.modular.com/t/apple-silicon-gpu-support-in-mojo/2295)

<div class="topic-metadata">

**Author:** [@BradLarson](https://forum.modular.com/u/BradLarson)\
**Replies:** 15\
**Last updated:** [March 11, 2026, 8:19pm UTC](https://forum.modular.com/t/apple-silicon-gpu-support-in-mojo/2295 "2026-03-11T20:19:23Z")

</div>

The latest nightly releases of Mojo (and our next stable release) include initial support for a new accelerator architecture: Apple Silicon GPUs! We know that one of the biggest barriers to programming GPUs is access to…

---

## [CDNA2 / MI250X support?](https://forum.modular.com/t/cdna2-mi250x-support/2821)

<div class="topic-metadata">

**Author:** [@bwibking](https://forum.modular.com/u/bwibking)\
**Replies:** 2\
**Last updated:** [March 8, 2026, 5:23pm UTC](https://forum.modular.com/t/cdna2-mi250x-support/2821 "2026-03-08T17:23:19Z")

</div>

Hi, I have been running Mojo successfully on Hopper and Apple Silicon, but my production workloads run on a Cray EX AMD MI250X system. I tried running it there out of the box, but I get “no compatible GPU detected.” Are…

---

## [Mojo equivalent for CUDA \_\_maxnreg\_\_](https://forum.modular.com/t/mojo-equivalent-for-cuda-maxnreg/2806)

<div class="topic-metadata">

**Author:** [@massimim](https://forum.modular.com/u/massimim)\
**Replies:** 0\
**Last updated:** [March 4, 2026, 8:35pm UTC](https://forum.modular.com/t/mojo-equivalent-for-cuda-maxnreg/2806 "2026-03-04T20:35:39Z")

</div>

Controlling register pressure on GPUs is critical for performance. CUDA exposes a per-kernel mechanism to enforce a maximum number of registers per thread on the compiler. Is there something equivalent in Mojo? Referenc…

---

## [\[Proposal\] Korean Translation of Mojo GPU Puzzles](https://forum.modular.com/t/proposal-korean-translation-of-mojo-gpu-puzzles/2643)

<div class="topic-metadata">

**Author:** [@gzu](https://forum.modular.com/u/gzu)\
**Replies:** 10\
**Last updated:** [February 19, 2026, 1:56pm UTC](https://forum.modular.com/t/proposal-korean-translation-of-mojo-gpu-puzzles/2643 "2026-02-19T13:56:25Z")

</div>

I’m really into puzzles.modular.com and have made a few contributions to the repo. I pitched this idea to @Ehsan and he encouraged me to share it with the community, so here it is! I’m planning to translate the puzzles …

---

## [Custom MultiHead Self Attention Transformer Training Phase using AMD RX 9070 XT 16GB. Python/Pythorch Vs Mojo](https://forum.modular.com/t/custom-multihead-self-attention-transformer-training-phase-using-amd-rx-9070-xt-16gb-python-pythorch-vs-mojo/2633)

<div class="topic-metadata">

**Author:** [@Andrea](https://forum.modular.com/u/Andrea)\
**Replies:** 6\
**Last updated:** [February 7, 2026, 4:57pm UTC](https://forum.modular.com/t/custom-multihead-self-attention-transformer-training-phase-using-amd-rx-9070-xt-16gb-python-pythorch-vs-mojo/2633 "2026-02-07T16:57:48Z")

</div>

I wrote a program in python that uses the pytorch package that performs the four steps to build an LLM and use it. Preparation of the data corpus. Training on unsupervised data (wikipedia dump). Training on supervised …

---

## [Support for Huawei GPU hardware](https://forum.modular.com/t/support-for-huawei-gpu-hardware/2682)

<div class="topic-metadata">

**Author:** [@Hylke](https://forum.modular.com/u/Hylke)\
**Replies:** 1\
**Last updated:** [February 3, 2026, 8:49am UTC](https://forum.modular.com/t/support-for-huawei-gpu-hardware/2682 "2026-02-03T08:49:09Z")

</div>

Hi, I was wondering if there are plans to support some of the Huawei Ascend product line? Here in Europe, the call to government-paid institutions to diversify to non-US hardware has intensified over the last few months…

---

## [\`has\_apple\_gpu\_accelerator()\` is False on jupyter-lab on my Macbook](https://forum.modular.com/t/has-apple-gpu-accelerator-is-false-on-jupyter-lab-on-my-macbook/2488)

<div class="topic-metadata">

**Author:** [@fzngagan](https://forum.modular.com/u/fzngagan)\
**Replies:** 2\
**Last updated:** [November 29, 2025, 9:30am UTC](https://forum.modular.com/t/has-apple-gpu-accelerator-is-false-on-jupyter-lab-on-my-macbook/2488 "2025-11-29T09:30:31Z")

</div>

from sys import has\_apple\_gpu\_accelerator print(has\_apple\_gpu\_accelerator()) gives False on jupyter-lab on my Macbook AIr M4. Is there a way to get it to work in jupyter? Also, can I get syntax highlighting in jupyter f…

---

## [Relationship between \`NDBuffer\` and \`LayoutTensor\`](https://forum.modular.com/t/relationship-between-ndbuffer-and-layouttensor/1595)

<div class="topic-metadata">

**Author:** [@femtomc](https://forum.modular.com/u/femtomc)\
**Replies:** 4\
**Last updated:** [November 18, 2025, 7:19pm UTC](https://forum.modular.com/t/relationship-between-ndbuffer-and-layouttensor/1595 "2025-11-18T19:19:00Z")

</div>

What is the relationship between NDBuffer and LayoutTensor? Most of the MAX AI kernels seem to use NDBuffer, but the kernel puzzles seem to prefer LayoutTensor. From my understanding of LayoutTensor, it’s a type designed…

---

## [Question regarding Mojo SOTA Blackwell matmul part 2 blog: about TMA load](https://forum.modular.com/t/question-regarding-mojo-sota-blackwell-matmul-part-2-blog-about-tma-load/2418)

<div class="topic-metadata">

**Author:** [@m4nhb4nhq](https://forum.modular.com/u/m4nhb4nhq)\
**Replies:** 3\
**Last updated:** [November 4, 2025, 8:41pm UTC](https://forum.modular.com/t/question-regarding-mojo-sota-blackwell-matmul-part-2-blog-about-tma-load/2418 "2025-11-04T20:41:49Z")

</div>

I had a great time reading the Mojo SOTA Blackwell matmul blog series and learned a lot about newest GPU features and architecture. While digging more deeply into each part, I’m currently confused about TMA loading from …

---

## [Calling GPU Math Functions from Bitcode (CUDA libdevice/ROCm OCML)](https://forum.modular.com/t/calling-gpu-math-functions-from-bitcode-cuda-libdevice-rocm-ocml/2363)

<div class="topic-metadata">

**Author:** [@leandrolcampos](https://forum.modular.com/u/leandrolcampos)\
**Replies:** 5\
**Last updated:** [October 16, 2025, 5:54pm UTC](https://forum.modular.com/t/calling-gpu-math-functions-from-bitcode-cuda-libdevice-rocm-ocml/2363 "2025-10-16T17:54:53Z")

</div>

Hi everyone, I’m interested in calling low-level math functions directly from NVIDIA’s CUDA libdevice (e.g., \_\_nv\_logf) and AMD’s ROCm OCML (e.g., \_\_ocml\_log\_f32) within Mojo. My primary goal is to benchmark these speci…

---

## [Question regarding \`copy\_dram\_to\_sram\_async\` in Puzzle 16 MatMul](https://forum.modular.com/t/question-regarding-copy-dram-to-sram-async-in-puzzle-16-matmul/2375)

<div class="topic-metadata">

**Author:** [@m4nhb4nhq](https://forum.modular.com/u/m4nhb4nhq)\
**Replies:** 1\
**Last updated:** [October 16, 2025, 11:32am UTC](https://forum.modular.com/t/question-regarding-copy-dram-to-sram-async-in-puzzle-16-matmul/2375 "2025-10-16T11:32:25Z")

</div>

Hi everyone. I’m a beginer trying to learn about GPU programming with Mojo. In Puzzle 16 it is suggested to use the following code to load data from global memory to shared memory alias load\_a\_layout = Layout.row\_major…

---

## [Puzzle 23. Why use strided loading of tiles?](https://forum.modular.com/t/puzzle-23-why-use-strided-loading-of-tiles/2322)

<div class="topic-metadata">

**Author:** [@cudawarped](https://forum.modular.com/u/cudawarped)\
**Replies:** 4\
**Last updated:** [October 3, 2025, 11:08pm UTC](https://forum.modular.com/t/puzzle-23-why-use-strided-loading-of-tiles/2322 "2025-10-03T23:08:38Z")

</div>

In Puzzle 23 the tiling approach is proposed to increase cache locality. This approach swaps the coalesced global memory access used in the elementwise approach for striped uncoalesced global memory access. Is the point…

---

## [Puzzle 23 CUDA SIMD load, store and basic ops](https://forum.modular.com/t/puzzle-23-cuda-simd-load-store-and-basic-ops/2319)

<div class="topic-metadata">

**Author:** [@cudawarped](https://forum.modular.com/u/cudawarped)\
**Replies:** 1\
**Last updated:** [October 3, 2025, 10:16pm UTC](https://forum.modular.com/t/puzzle-23-cuda-simd-load-store-and-basic-ops/2319 "2025-10-03T22:16:57Z")

</div>

In the solution to Puzzle 23 the simple add function is supposed to load and store SIMD\_WIDTH values at a time and perform SIMD addition in one instruction on those values if available. Currently it perfoms the loads, s…

---

## [GPU Programming on Mac](https://forum.modular.com/t/gpu-programming-on-mac/2174)

<div class="topic-metadata">

**Author:** [@a10i](https://forum.modular.com/u/a10i)\
**Replies:** 14\
**Last updated:** [September 21, 2025, 4:01pm UTC](https://forum.modular.com/t/gpu-programming-on-mac/2174 "2025-09-21T16:01:13Z")

</div>

Hello everyone, I am an iOS developer looking to switch fields and interested in, but new to the GPU programming world, and only have access to an Apple silicon MacBook. According to the system requirements for Macs at…

---

## [Compatability for GP107M \[GeForce GTX 1050 Mobile\]?](https://forum.modular.com/t/compatability-for-gp107m-geforce-gtx-1050-mobile/1750)

<div class="topic-metadata">

**Author:** [@EzRyder](https://forum.modular.com/u/EzRyder)\
**Replies:** 11\
**Last updated:** [September 9, 2025, 4:58pm UTC](https://forum.modular.com/t/compatability-for-gp107m-geforce-gtx-1050-mobile/1750 "2025-09-09T16:58:27Z")

</div>

I’m just starting 🔥 Introduction - Mojo 🔥 GPU Puzzles, and on Puzzle 01 am getting the error shown below. I assume this is because my laptop’s GPU is not yet supported: GP107M \[GeForce GTX 1050 Mobile\]. If this is the ca…

[Next page](https://forum.modular.com/c/gpu-programming/24.md?page=1)
