Page MenuHome

GPU viewport rendering fails with “CUDA error at cuCtxCreate: Invalid device” for gtx 960 but works for gtx 1050ti. F12 works.
Closed, ArchivedPublic

Description

I have a desktop computer with a gtx 660, a gtx 960 and a gtx 1050ti

I installed version 375 of the nvidia drivers from ppa:graphics-drivers/ppa on ubuntu 16.04 in order to make a 1050ti card function.

After a reboot everything was working. Then the system offered to apply some updates which IIRC didn't have anything to do with graphics, or blender, and since then when I try to render with the gtx 960 I get

CUDA error at cuCtxCreate: Invalid device

Refer to the Cycles GPU rendering documentation for possible solutions:
http://www.blender.org/manual/render/cycles/gpu_rendering.html

CUDA error at cuCtxCreate: Invalid device

Refer to the Cycles GPU rendering documentation for possible solutions:
http://www.blender.org/manual/render/cycles/gpu_rendering.html

CUDA error: Invalid context in cuMemAlloc(&device_pointer, size)
CUDA error: Invalid context in cuMemAlloc(&device_pointer, size)
CUDA error: Invalid context in cuMemAlloc(&device_pointer, size)
CUDA error: Invalid context in cuMemAlloc(&device_pointer, size)
CUDA error: Invalid context in cuMemAlloc(&device_pointer, size)
CUDA error: Invalid context in cuMemAlloc(&device_pointer, size)

Full log with --debug-cycles here:

Rendering with the 1050ti works okay. I tried installing cuda 8.0 with the run file from nvidia's website but the problem remains.

Note that cuda 8.0 says my configuration is unsupported and wants to revert to drivers 367 but this will cause the 1050ti to be ignored.

Afterwards, I reverted to the previous situation (nvidia-367 + cuda-toolkit from the repo), and I also tried nvidia-367 with cuda-toolkit-8.0 from nvidia (the recommended configuration) and still no joy.

I also tried resetting blender preferences (not during reverted drivers though) and deleting precompiled kernels with no success.

This bug is only manifests in viewport rendering. F12 works fine (I can see all three tiles rendering) until I try to enable viewport rendered shading. After that F12 fails with

CUDA error: Invalid value in cuCtxDestroy(cuContext)
CUDA error: Invalid value in cuCtxDestroy(cuContext)
Error: CUDA error at cuCtxCreate: Invalid value

Full log with --debug-cycles continued from above:

I have tried with the Thomas Schiex ppa blender, *blender 2.78a* downloaded from blender.org, *blender-2.78-dd58390-linux-glibc219-x86_64* also downloaded from blender.org as well as the blender pbr branch which is a modified 2.77 release. All versions exhibit the same problem.

All attempts made with the default cube scene.

deviceQuery log:

other nvidia samples work fine with all cards

Blender on windows on the same machine functions correctly (though I think rendering is significantly slower)

Details

Type
Bug

Event Timeline

More tests show that the card series actually doesn't matter. When I select any two cards the system breaks. Any single card works.

I just happened to test the 1050 by itself with a "clean" blender, while when I tested the 960 by itself I had already tried with two cards.

More info:

Opening blender and doing the following renders in sequence:
960+1050ti+1080 F12 -> success
960 -> success, both F12 & viewport
1050ti -> success both F12 & viewport
1080 (new, installed today) -> success both F12 & viewport
1050ti + 1080 -> success F12, failed viewport
1050ti + 1080 -> now F12 fails too (invalid value)
1080 -> success, both
1050ti + 1080 -> both fail
960 -> both fail (invalid device)
1050ti -> both succeed
1080 -> both succeed
1050ti + 1080 -> both fail

I suspect it's something to do with enumeration of devices.

On clean ubuntu-gnome 16.04 install cuda works alright so it looks like it might be something with my configuration.

I don't know if this bug is worth being open anymore, maybe it's an edge case that should be somehow taken into consideration.

Feel free to close it, but I'd appreciate any pointers that might help fixing it.

Bastien Montagne (mont29) closed this task as Archived.
Bastien Montagne (mont29) claimed this task.

Yes, sounds indeed like a configuration-specific issue, we cannot do much here… GPU drivers are often a pain to handle :/