# CUDA Example "Particles" is crashing at startup

**URL:** <https://forums.developer.nvidia.com/t/cuda-example-particles-is-crashing-at-startup/174354>\
**Category:** CUDA Setup and Installation\
**Created:** [April 6, 2021, 7:11pm UTC](https://forums.developer.nvidia.com/t/cuda-example-particles-is-crashing-at-startup/174354 "2021-04-06T19:11:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![whaeffner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@whaeffner](https://forums.developer.nvidia.com/u/whaeffner)\
**Post date:** [April 6, 2021, 7:11pm UTC](https://forums.developer.nvidia.com/t/cuda-example-particles-is-crashing-at-startup/174354/1 "2021-04-06T19:11:58Z")

</div>

Hi,

just tried to run various CUDA samples from folder 5\_Simulations. All but “Particles” are executing correctly. “Particles” compiles without an error, but at start it breaks immediately after an empty graphics window pops up.  
Terminal output is

CUDA Particles Simulation Starting…

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

grid: 64 x 64 x 64 = 262144 cells  
particles: 16384  
GPU Device 0: “Pascal” with compute capability 6.1

CUDA error 700 [C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include\cub\device\dispatch/dispatch\_radix\_sort.cuh, 1016]: an illegal memory access was encountered  
CUDA error 700 [C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include\cub\device\dispatch/dispatch\_radix\_sort.cuh, 1211]: an illegal memory access was encountered  
CUDA error 700 [C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include\cub\device\dispatch/dispatch\_radix\_sort.cuh, 1311]: an illegal memory access was encountered  
CUDA error at C:/ProgramData/NVIDIA Corporation/CUDA Samples/v11.0/5\_Simulations/particles/particleSystem\_cuda.cu:90 code=700(cudaErrorIllegalAddress) “cudaGraphicsMapResources(1, cuda\_vbo\_resource, 0)”

I have no idea how to solve this issue. Btw, I had exactly the same negative outcome on my notebook with CUDA 11.2.2 installed. Hope someone has some helpful hints.

My environment is Windows 10 Pro, 64bit, GTX 1080, cuda\_11.0.2\_451.48\_win10, Visual Studio 2019  
(Also tried 465.89 without any success)

Walter

---

<div class="post-metadata">

**Author:** ![StefanG3D](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@StefanG3D](https://forums.developer.nvidia.com/u/StefanG3D)\
**Post date:** [April 8, 2021, 5:46pm UTC](https://forums.developer.nvidia.com/t/cuda-example-particles-is-crashing-at-startup/174354/2 "2021-04-08T17:46:35Z")

</div>

I had built that sample successfully in February.

Now i have tried again and can confirm your issue - in debug mode.  
In release mode building even fails.  
A regression in latest MSVC updates?

| Schweregrad | Code | Beschreibung | Projekt | Datei | Zeile | Unterdrückungszustand |
| --- | --- | --- | --- | --- | --- | --- |
| Fehler | MSB3721 | Der Befehl C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nvcc.exe -gencode=arch=compute\_35,code=\sm\_35,compute\_35\ -gencode=arch=compute\_37,code=\sm\_37,compute\_37\ -gencode=arch=compute\_50,code=\sm\_50,compute\_50\ -gencode=arch=compute\_52,code=\sm\_52,compute\_52\ -gencode=arch=compute\_60,code=\sm\_60,compute\_60\ -gencode=arch=compute\_61,code=\sm\_61,compute\_61\ -gencode=arch=compute\_70,code=\sm\_70,compute\_70\ -gencode=arch=compute\_75,code=\sm\_75,compute\_75\ -gencode=arch=compute\_80,code=\sm\_80,compute\_80\ -gencode=arch=compute\_86,code=\sm\_86,compute\_86\ –use-local-env -ccbin C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64 -x cu -I./ -I…/…/common/inc -I./ -IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2/include -I…/…/common/inc -IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static --threads 0 -DWIN32 -DWIN32 -D\_MBCS -D\_MBCS -Xcompiler /EHsc /W3 /nologo /O2 /Fdx64/Release/vc142.pdb /FS /MT -o x64/Release/particleSystem\_cuda.cu.obj c:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\5\_Simulations\particles\particleSystem\_cuda.cu wurde mit Code -1 beendet. | particles | C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.2.targets | 785 | |
| Warnung | | The ‘compute\_35’, ‘compute\_37’, ‘compute\_50’, ‘sm\_35’, ‘sm\_37’ and ‘sm\_50’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). | particles | c:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\5\_Simulations\particles\CUDACOMPILE | 1 | |
| Fehler | | calling a **host** function(\_\_floorf) from a **device** function(calcGridPos) is not allowed | particles | c:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\5\_Simulations\particles\particles\_kernel\_impl.cuh | 105 | |
| Fehler | | identifier \_\_floorf is undefined in device code | particles | c:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\5\_Simulations\particles\particles\_kernel\_impl.cuh | 105 | |
| Fehler | | calling a **host** function(\_\_floorf) from a **device** function(calcGridPos) is not allowed | particles | c:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\5\_Simulations\particles\particles\_kernel\_impl.cuh | 106 | |
| Fehler | | identifier \_\_floorf is undefined in device code | particles | c:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\5\_Simulations\particles\particles\_kernel\_impl.cuh | 106 | |
| Fehler | | calling a **host** function(\_\_floorf) from a **device** function(calcGridPos) is not allowed | particles | c:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\5\_Simulations\particles\particles\_kernel\_impl.cuh | 107 | |
| Fehler | | identifier \_\_floorf is undefined in device code | particles | c:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\5\_Simulations\particles\particles\_kernel\_impl.cuh | 107 | |
