Create .ptx files from .cu files

13 visualizaciones (últimos 30 días)
Alexandre
Alexandre el 28 de Jul. de 2014
Editada: Herve Hugonnet el 8 de Mayo de 2020
Hi everyone,
I am completely knew to Cuda and wanted to practice with Matlab. Here is the code I wanted to run :
When downloaded the files, there were some .cu files. Therefore I read this :
It looks like .cu files have to be compiled to produce .ptx files that can then be run by Matlab. However, after hours and hours (and hours) of unsuccessful tries, I never made it. I installed Visual Studio 2012, then CUDA toolkit 6.0 and tried to run
nvcc -ptx "my file"
but I never passed the "cl.exe is not in PATH" error... And I tried many many things, like adding the path in ALL my environment variables...
So, it looks like it never manages to find cl.exe automatically, but I have found it (in different folder). Is there a way to manually add it when I type
nvcc -ptx "my file"
? Or maybe someone has a working step by step tutorial that works to compile the .cu files ?
Thanks for your help,
Alex
  1 comentario
Edric Ellis
Edric Ellis el 29 de Jul. de 2014
Have you tried launching a "Visual Studio Command Prompt" from the "Start" menu and then using NVCC from there?

Iniciar sesión para comentar.

Respuestas (1)

Herve Hugonnet
Herve Hugonnet el 8 de Mayo de 2020
Editada: Herve Hugonnet el 8 de Mayo de 2020
I had the same issue and solved it by adding the path to the cl.exe filed in the comand line (change the path to match your visual studio installation) :
nvcc -ptx "test_kernel.cu" -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64"
Also make sure you installed cuda

Categorías

Más información sobre GPU Computing en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by