Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using DoublePrecision #106

Open
Kalkasas opened this issue Nov 29, 2017 · 4 comments
Open

Error when using DoublePrecision #106

Kalkasas opened this issue Nov 29, 2017 · 4 comments
Assignees
Labels

Comments

@Kalkasas
Copy link

When enabling Double Precision I get:

/home/dl/projects/Optlang/Opt/API/src/util.t:796: cuModuleLoadData: cuda reported error 218
stack traceback:
	[C]: in function 'error'
	[string "<string>"]:243: in function 'cudacompile'
	/home/dl/projects/Optlang/Opt/API/src/util.t:796: in function 'makeGPUFunctions'
	...e/dl/projects/Optlang/Opt/API/src/solverGPUGaussNewton.t:728: in function 'compilePlan'
	/home/dl/projects/Optlang/Opt/API/src/o.t:870: in function </home/dl/projects/Optlang/Opt/API/src/o.t:862>
	[C]: in function 'xpcall'
	/home/dl/projects/Optlang/Opt/API/src/o.t:862: in function </home/dl/projects/Optlang/Opt/API/src/o.t:861>
optical_flow: src/../../shared/OptSolver.h:56: OptSolver::OptSolver(const std::vector<unsigned int> &, const std::string &, const std::string &, bool): Assertion `m_plan' failed.

What can I do to fix this problem?

@Mx7f Mx7f added the bug label Nov 29, 2017
@Mx7f Mx7f self-assigned this Nov 29, 2017
@Mx7f
Copy link
Collaborator

Mx7f commented Nov 29, 2017

Hmm, 218 is an invalid ptx error. I have added a new level of verbosity in the latest branch: if you pull and recompile, and set your Opt_InitializationParameters.verbosityLevel to 3 it should dump out a lot of extra information. If you put the output here I might be able to take a guess at what is going wrong.

@Kalkasas
Copy link
Author

Kalkasas commented Nov 30, 2017

After pulling the latest branch I realized that I fiddled with the opt code in order to make it run. This might be the reason for this error.

Running the minimal_graph_only test with single precision led to:

src/tcuda.cpp:139: nvvm error reported (7)
 libnvvm : error: -arch=compute_61 is an unsupported option

stack traceback:
	[C]: in function 'toptximpl'
	src/cudalib.lua:84: in function 'toptx'
	[string "<string>"]:238: in function 'cudacompile'
	/home/dl/projects/Optlang/Opt/API/src/util.t:873: in function 'makeGPUFunctions'
	...e/dl/projects/Optlang/Opt/API/src/solverGPUGaussNewton.t:751: in function 'compilePlan'
	/home/dl/projects/Optlang/Opt/API/src/o.t:870: in function </home/dl/projects/Optlang/Opt/API/src/o.t:862>
	[C]: in function 'xpcall'
	/home/dl/projects/Optlang/Opt/API/src/o.t:862: in function </home/dl/projects/Optlang/Opt/API/src/o.t:861>
0   terra (JIT)                         0x00007f1fb163200d $opt.ProblemSolve + 13 
./dense() [0x4275bc]
Segmentation fault

I modified the cudacompille call in util.t
local kernels = terralib.cudacompile(kernelFunctions, verbosePTX,30)
Now single precision works for all examples. Enabling double precision leads to the error 218.

The output is attached to this post. /usr/local/cuda points to a cuda 7.5 installation.
out.txt

@Mx7f
Copy link
Collaborator

Mx7f commented Dec 14, 2017

I believe this is some poor interaction between atomic double precision float adds and your version of nvvm. One workaround for now is to set pascalOrBetterGPU = false on line 127 of util.t, but this will make double precision atomics slow.

The other, better, workaround, is to switch to CUDA 8.0, like in #99 . Though I don't know what errors you might run into there.

@Kalkasas
Copy link
Author

Kalkasas commented Dec 15, 2017

At the moment I am using the terra binaries mentioned in the readme file. I assume I have to change the version as well when I am compiling with CUDA 8.0? I think I am going to stick with single precision for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants