Error in my code...

Hello,
I’m starting with the work of GPUs. I have a GeForce GTX 970 and I’m programming in Visual Studio. When I compile my code generates the following error:

1> ptxas C:/Users/blopez/AppData/Local/Temp/tmpxft_00000d1c_00000000-4_Proyecto_CUDA.ptx, line 806; fatal : Parsing error near ‘-’: syntax error
1> ptxas fatal : Ptx assembly aborted due to errors
1> Proyecto_CUDA.cu

Please, I hope someone can help me

Thanks

how many errors did the compiler report prior to this message? none or several?
i am trying to determine whether the compiler gave up due to a single error, or due to too many errors - a number of compilers have a maximum number or error cut-off, and it is always fun to attain this cut-off limit; at that point the compiler decides that it is perhaps better of to instead go fishing

if no errors precede this error, what happens when you change/ correct/ omit line 806? does the compiler then move on or not (i.e. fix the syntax error the compiler complains about at line 806 and see whether it then moves on or not)

Hello, thanks for your reply, which generates is as follows:

Now I’ve tried with another code but the error is the same.

1>------ Operación Volver a generar todo iniciada: proyecto: matrixMul, configuración: Debug Win32 ------
1>Compilación iniciada a las 18/12/2014 10:16:06.
1>_PrepareForClean:
1> Se eliminará el archivo “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.lastbuildstate”.
1>AfterClean:
1> Se eliminará el archivo “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\bin\Win32_Debug_vc100\cudart32_65.dll”.
1>CudaClean:
1>
1> C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin\nvcc.exe” -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I…\Common -I…\Common\C99 -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" -G --keep-dir “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100” -maxrregcount=0 --machine 32 --compile -g -D_DEBUG -DWIN32 -D_CONSOLE -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.cu.obj” “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\matrixMul.cu” -clean
1> matrixMul.cu
1> Se eliminará el archivo “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.cu.deps”.
1>InitializeBuildStatus:
1> Se creará “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.unsuccessfulbuild” porque se especificó “AlwaysCreate”.
1>CudaBuild:
1> Compiling CUDA source file matrixMul.cu…
1>
1> C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin\nvcc.exe” -gencode=arch=compute_52,code=“sm_52,compute_52” --use-local-env --cl-version 2010 -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I…\Common -I…\Common\C99 -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" -G --keep-dir “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100” -maxrregcount=0 --machine 32 --compile -cudart static -g -D_DEBUG -DWIN32 -D_CONSOLE -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.cu.obj” “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\matrixMul.cu”
1> ptxas C:/Users/blopez/AppData/Local/Temp/tmpxft_000010fc_00000000-4_matrixMul.ptx, line 592; fatal : Parsing error near ‘-’: syntax error
1> ptxas fatal : Ptx assembly aborted due to errors
1> matrixMul.cu
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 6.5.targets(593,9): error MSB3721: El comando ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin\nvcc.exe” -gencode=arch=compute_52,code=“sm_52,compute_52” --use-local-env --cl-version 2010 -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I…\Common -I…\Common\C99 -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include” -G --keep-dir “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100” -maxrregcount=0 --machine 32 --compile -cudart static -g -D_DEBUG -DWIN32 -D_CONSOLE -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.cu.obj” “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\matrixMul.cu”” salió con el código 255.
1>
1>ERROR al compilar.
1>
1>Tiempo transcurrido 00:00:02.80
========== Volver a generar todo: 0 correctos, 1 incorrectos, 0 omitidos ==========

What I can do to fix this?

i am now faced with a moral question:

a) pretend that i am sufficiently fluent in what appears to be spanish
b) admit that i hardly comprehend a word of spanish

i think i am going to go with a)

it seems you are getting 2 errors: msb3721, 255 - which i suppose means that winblows can not get the built file, because it never built
probably because ptx fatally exited at line 592
the fact that the ptx file contains a syntax error may be because you are passing ‘sub-optimal’ values to the compiler

perhaps (you could post an english version, such that) someone can help check what you pass to the compiler in the 1st place

Hi, I apologize for the gaffe, the problem is that I use Visual Studio in Spanish. I’ve done the translation himself, here you go:

1>------ Operation Rebuild All started: proyect: matrixMul, configuración: Debug Win32 ------
1> Compilation began at 18/12/2014 10:16:06.
1>_PrepareForClean:
1> The file will be deleted “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.lastbuildstate”.
1>AfterClean:
1> The file will be deleted “C:\BÁRBARO\Nueva carpeta\CUDA\Debugging\Matrix Multiply\bin\Win32_Debug_vc100\cudart32_65.dll”.
1>CudaClean:
1>
1> C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin\nvcc.exe” -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I…\Common -I…\Common\C99 -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" -G --keep-dir “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100” -maxrregcount=0 --machine 32 --compile -g -D_DEBUG -DWIN32 -D_CONSOLE -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.cu.obj” “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\matrixMul.cu” -clean
1> matrixMul.cu
1> The file will be deleted “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.cu.deps”.
1>InitializeBuildStatus:
1> Will be created “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.unsuccessfulbuild” because it was specified “AlwaysCreate”.
1>CudaBuild:
1> Compiling CUDA source file matrixMul.cu…
1>
1> C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin\nvcc.exe” -gencode=arch=compute_52,code=“sm_52,compute_52” --use-local-env --cl-version 2010 -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I…\Common -I…\Common\C99 -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include" -G --keep-dir “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100” -maxrregcount=0 --machine 32 --compile -cudart static -g -D_DEBUG -DWIN32 -D_CONSOLE -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.cu.obj” “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\matrixMul.cu”
1> ptxas C:/Users/blopez/AppData/Local/Temp/tmpxft_000010fc_00000000-4_matrixMul.ptx, line 592; fatal : Parsing error near ‘-’: syntax error
1> ptxas fatal : Ptx assembly aborted due to errors
1> matrixMul.cu
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 6.5.targets(593,9): error MSB3721: The comand ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin\nvcc.exe” -gencode=arch=compute_52,code=“sm_52,compute_52” --use-local-env --cl-version 2010 -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I…\Common -I…\Common\C99 -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\include” -G --keep-dir “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100” -maxrregcount=0 --machine 32 --compile -cudart static -g -D_DEBUG -DWIN32 -D_CONSOLE -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\obj\Win32_Debug_vc100\matrixMul.cu.obj” “C:\BÁRBARO\ New folder \CUDA\Debugging\Matrix Multiply\matrixMul.cu”” exited with code 255.
1>
1> ERROR when compiling.
1>
1> Elapsed time 00:00:02.80
========== Rebuild All: 0 correct, 1 failed, 0 skipped ==========

An interesting detail just discovered:
1- if I choose “No” in “Generate GPU Debug Information”, the project works properly, but I can not debug.
2- if I choose “Yes” in “Generate GPU Debug Information”, the project does not work properly, and of course, I can not debug.

I hope you can help me… Thanks

a) have you set any of the compiler parameters, or are you using what can be described as standard/ ‘default’ settings?

b) can you i) compile and ii) debug any of the cuda (6.5 preferably) samples?

c) is this the 1st project to generate the error - have you managed to compile other prior projects on the same machine?

d) can you possibly peak at C:/Users/blopez/AppData/Local/Temp/tmpxft_000010fc_00000000-4_matrixMul.ptx - line 592; this might also provide a hint as to why the compiler’s stomach is upset

e) do you need separate compilation, and have you enabled separate compilation?

f) you seem to be building 32 bit; what happens when you build 64 bit?

Responding to some pregunats you do to me:

a. I have not changed any parameters from the original project.

b. This project is an example of Nsight Visual Studio, exactly as shown in:http://docs.nvidia.com/nsight-visual-studio-edition/4.2/Nsight_Visual_Studio_Edition_User_Guide.htm#Using_CUDA_Debugger.htm

c. I compiled other projects and generate the same error

d. The file C: /Users/blopez/AppData/Local/Temp/tmpxft_000010fc_00000000-4_matrixMul.ptx there, so I can not find

e. <Here I do not understand what you want me pregunat, but as I said earlier, I have not changed anything from the original instance

f. The Visual Studio I have installed is 32 bits

An interesting detail just discovered:
1- if I choose “No” in “Generate GPU Debug Information”, the project works properly, but I can not debug.
2- if I choose “Yes” in “Generate GPU Debug Information”, the project does not work properly, and of course, I can not debug.

I hope you can help me… Thanks

if you can not properly compile and debug a sample, and if this is so for a number of samples, it would suggest to me that the underlying problem is platform/ installation/ machine related, rather than project/ code related

one of the ways to verify an installation is indeed to see whether one can compile and run samples

did you download cuda 6.5 with support for 970/ 980, or just cuda 6.5?

does cuda pick up your device? does deviceQuery work?

Hello,

I do not know if you read the last part of my post, I repeat here

An interesting detail just discovered:
1- if I choose “No” in “Generate GPU Debug Information”, the project works properly, but I can not debug.
2- if I choose “Yes” in “Generate GPU Debug Information”, the project does not work properly, and of course, I can not debug.

Maybe this can give you an idea of where my mistake

I use cuda_6.5.19_windows_general_64

https://developer.nvidia.com/cuda-downloads-geforce-gtx9xx

The CUDA deviceQuery example works correctly, here I am sending you a picture of it.

An interesting detail just discovered:
1- if I choose “No” in “Generate GPU Debug Information”, the project works properly, but I can not debug.
2- if I choose “Yes” in “Generate GPU Debug Information”, the project does not work properly, and of course, I can not debug.

yes, that is just fascinating
however, i simply interpret this as signs of: “loose bolts”; “things not linking/ connecting/ working as they should”, or my all time favourite: “YMMV”, a cuda term coined by cuda maestro txbob

this genrally happens when you create an “undefined userspace” - for instance, installing cuda on arch-linux, or mint, (2 flavours of linux, not supported by cuda to my knowledge) or when using gcc 4.9, when you are really supposed to use 4.8 for instance

the reason why i asked about your cuda version, is that the general cuda download page notes:

“If you are developing with CUDA 6.5 on a GeForce GTX980 or GTX970 download CUDA 6.5 Toolkits with support for your GPU”

your cuda version would support your device; however: perhaps you should install the 32 bit version, seeing that your VS version is 32 bit…?
i do not know whether it is possible/ advisable to install a 64 bit cuda version on top of a 32 bit ide; perhaps someone can shed light on this, or perhaps you can simply install the 32 bit version and see if it helps
i really think that cuda and the ide might have difficulty shaking hands, when the one is 64 bit and the other 32 bit; i may be wrong
i am still under the impression that you use a 32 bit VS

Before working with this GPU, I worked with a GeForce 8400 gs (quite old) and had a computer with a 32-bit operating system and also the same error is generated. Option so far
I had no problems. Jan ste But now I need to debug a code. let me ask you a question:

Can you debug using visual studio 4.1 nsight using “Generate GPU Debug Information” -> “No”?

I’ve tried, but when I use Start Debugging CUDA ignores breakpoints in the code positions. See image

" I worked with a GeForce 8400 gs (quite old) and had a computer with a 32-bit operating system and also the same error is generated"

the 8400/ machine is really a separate case, isn’t it?

perhaps you then also installed a 64 bit cuda with a 32 bit ide

1- if I choose “No” in “Generate GPU Debug Information”, the project works properly, but I can not debug.
2- if I choose “Yes” in “Generate GPU Debug Information”, the project does not work properly, and of course, I can not debug.

if you repeat this experiment for any and all of the cuda samples, i guarantee you that you would each time observe the same outcome, which really should point you towards the setup, not the code/ samples

" when I use Start Debugging CUDA ignores breakpoints in the code positions"

does this sound right?

by default, a correct setup should be able to debug any project, if it passed compilation

moreover, this should again point you towards setup, not code; setup determines the ability of the debugger to function correctly, and not code

i honestly see no causality between user code and a failing debugger; maybe you can explain this to me

cuda as ‘package’ is complex - on linux for instance, it integrates the eclipse ide (generally a stand alone ide), the gnu c compiler and the cuda/ nvidia driver/ libraries, etc

does it rewrite the ide - no, it simply ‘attaches’
does it rewrite the host c compiler - no, it simply ‘attaches’

similarly, for winblows, cuda does not replace the c compiler or ide, it just ‘attaches’

if it ‘attaches’ incorrectly, you are about to witness and experience the kind of problems you now have

and you have to ask yourself whether cuda can attach correctly, if it is 64 bit, and what it attaches to is 32 bit - i doubt; maybe i am wrong

let me ask you a question: if you run a 32 bit ide, can you install a 64 bit plug-in?