Skip to content

Commit

Permalink
fix skipping of CUDA error when arch is not specified
Browse files Browse the repository at this point in the history
Useful when compiling CUDA shaders on build server without NVidia GPU
(but with NVidia CUDA Toolkit) and specifiying target GPU architecture
with `options` argument.
  • Loading branch information
rutsky committed Jun 17, 2015
1 parent 45f0608 commit e282410
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pycuda/compiler.py
Expand Up @@ -201,10 +201,11 @@ def compile(source, nvcc="nvcc", options=None, keep=False,

options = options[:]
if arch is None:
from pycuda.driver import Error
try:
from pycuda.driver import Context
arch = "sm_%d%d" % Context.get_device().compute_capability()
except RuntimeError:
except Error:
pass

from pycuda.driver import CUDA_DEBUGGING
Expand Down

0 comments on commit e282410

Please sign in to comment.