question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`NVRTCError` raised on Maxwell or earlier GPUs

See original GitHub issue

Description

I’ve installed CuPy version ‘10.3.0’ on Windows. I created an array and want to convert to other datatype using array.astype(…) but it leads to error

To Reproduce

Code

import cupy as cp
a=cp.array([1, 2]).astype(cp.float32)

Error message

---------------------------------------------------------------------------
NVRTCError                                Traceback (most recent call last)
D:\anaconda3\lib\site-packages\cupy\cuda\compiler.py in compile(self, options, log_stream)
    684                     nvrtc.addNameExpression(self.ptr, ker)
--> 685             nvrtc.compileProgram(self.ptr, options)
    686             mapping = None

cupy_backends\cuda\libs\nvrtc.pyx in cupy_backends.cuda.libs.nvrtc.compileProgram()

cupy_backends\cuda\libs\nvrtc.pyx in cupy_backends.cuda.libs.nvrtc.compileProgram()

cupy_backends\cuda\libs\nvrtc.pyx in cupy_backends.cuda.libs.nvrtc.check_status()

NVRTCError: NVRTC_ERROR_COMPILATION (6)

During handling of the above exception, another exception occurred:

CompileException                          Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_129232/2912708919.py in <module>
      1 import cupy as cp
----> 2 a=cp.array([1, 2]).astype(cp.float32)

cupy\_core\core.pyx in cupy._core.core.ndarray.astype()

cupy\_core\core.pyx in cupy._core.core.ndarray.astype()

cupy\_core\_kernel.pyx in cupy._core._kernel.ufunc.__call__()

cupy\_core\_kernel.pyx in cupy._core._kernel.ufunc._get_ufunc_kernel()

cupy\_core\_kernel.pyx in cupy._core._kernel._get_ufunc_kernel()

cupy\_core\_kernel.pyx in cupy._core._kernel._get_simple_elementwise_kernel()

cupy\_core\core.pyx in cupy._core.core.compile_with_cache()

D:\anaconda3\lib\site-packages\cupy\cuda\compiler.py in _compile_module_with_cache(source, options, arch, cache_dir, extra_source, backend, enable_cooperative_groups, name_expressions, log_stream, jitify)
    490             name_expressions, log_stream, cache_in_memory)
    491     else:
--> 492         return _compile_with_cache_cuda(
    493             source, options, arch, cache_dir, extra_source, backend,
    494             enable_cooperative_groups, name_expressions, log_stream,

D:\anaconda3\lib\site-packages\cupy\cuda\compiler.py in _compile_with_cache_cuda(source, options, arch, cache_dir, extra_source, backend, enable_cooperative_groups, name_expressions, log_stream, cache_in_memory, jitify)
    568     if backend == 'nvrtc':
    569         cu_name = '' if cache_in_memory else name + '.cu'
--> 570         ptx, mapping = compile_using_nvrtc(
    571             source, options, arch, cu_name, name_expressions,
    572             log_stream, cache_in_memory, jitify)

D:\anaconda3\lib\site-packages\cupy\cuda\compiler.py in compile_using_nvrtc(source, options, arch, filename, name_expressions, log_stream, cache_in_memory, jitify)
    319                 cu_file.write(source)
    320 
--> 321             return _compile(source, options, cu_path,
    322                             name_expressions, log_stream, jitify)
    323     else:

D:\anaconda3\lib\site-packages\cupy\cuda\compiler.py in _compile(source, options, cu_path, name_expressions, log_stream, jitify)
    303 
    304         try:
--> 305             compiled_obj, mapping = prog.compile(options, log_stream)
    306         except CompileException as e:
    307             dump = _get_bool_env_variable(

D:\anaconda3\lib\site-packages\cupy\cuda\compiler.py in compile(self, options, log_stream)
    700         except nvrtc.NVRTCError:
    701             log = nvrtc.getProgramLog(self.ptr)
--> 702             raise CompileException(log, self.src, self.name, options,
    703                                    'nvrtc' if not runtime.is_hip else 'hiprtc')
    704 

CompileException: D:\anaconda3\lib\site-packages\cupy\_core\include\cupy/carray.cuh(130): error: more than one conversion function from "half" to a built-in type applies:
            function "__half::operator float() const"
D:\anaconda3\lib\site-packages\cupy\_core\include\cupy\_cuda\cuda-11\cuda_fp16.hpp(204): here
            function "__half::operator short() const"
D:\anaconda3\lib\site-packages\cupy\_core\include\cupy\_cuda\cuda-11\cuda_fp16.hpp(222): here
            function "__half::operator unsigned short() const"
D:\anaconda3\lib\site-packages\cupy\_core\include\cupy\_cuda\cuda-11\cuda_fp16.hpp(225): here
            function "__half::operator int() const"
D:\anaconda3\lib\site-packages\cupy\_core\include\cupy\_cuda\cuda-11\cuda_fp16.hpp(228): here
            function "__half::operator unsigned int() const"
D:\anaconda3\lib\site-packages\cupy\_core\include\cupy\_cuda\cuda-11\cuda_fp16.hpp(231): here
            function "__half::operator long long() const"
D:\anaconda3\lib\site-packages\cupy\_core\include\cupy\_cuda\cuda-11\cuda_fp16.hpp(234): here
            function "__half::operator unsigned long long() const"
D:\anaconda3\lib\site-packages\cupy\_core\include\cupy\_cuda\cuda-11\cuda_fp16.hpp(237): here
            function "__half::operator __nv_bool() const"
D:\anaconda3\lib\site-packages\cupy\_core\include\cupy\_cuda\cuda-11\cuda_fp16.hpp(241): here

1 error detected in the compilation of "C:\Users\Sam\AppData\Local\Temp\tmp561lep1m\328eb3900d18cfb25d20bc9256e53d94036656ce.cubin.cu".

Installation

Wheel (pip install cupy-***)

Environment

OS                           : Windows-10-10.0.19044-SP0
Python Version               : 3.9.7
CuPy Version                 : 10.3.0
CuPy Platform                : NVIDIA CUDA
NumPy Version                : 1.20.3
SciPy Version                : 1.7.1
Cython Build Version         : 0.29.28
Cython Runtime Version       : 0.29.24
CUDA Root                    : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5
nvcc PATH                    : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5\bin\nvcc.EXE
CUDA Build Version           : 11050
CUDA Driver Version          : 11050
CUDA Runtime Version         : 11050
cuBLAS Version               : (available)
cuFFT Version                : 10600
cuRAND Version               : 10207
cuSOLVER Version             : (11, 3, 2)
cuSPARSE Version             : (available)
NVRTC Version                : (11, 5)
Thrust Version               : 101301
CUB Build Version            : 101301
Jitify Build Version         : 4a37de0
cuDNN Build Version          : (not loaded; try `import cupy.cuda.cudnn` first)
cuDNN Version                : (not loaded; try `import cupy.cuda.cudnn` first)
NCCL Build Version           : None
NCCL Runtime Version         : None
cuTENSOR Version             : None
cuSPARSELt Build Version     : None
Device 0 Name                : NVIDIA GeForce GTX 965M
Device 0 Compute Capability  : 52
Device 0 PCI Bus ID          : 0000:01:00.0

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kmaehashicommented, Apr 6, 2022

We are preparing a hot-fix release v10.3.1 to address this issue. (no hot-fix planned for v11 pre-releases)

0reactions
samrerecommented, Apr 8, 2022

Brilliant! Keep up the good work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maxwell Architecture - NVIDIA Developer
Maxwell is NVIDIA's next-generation architecture for CUDA compute applications. Maxwell introduces an all-new design for the Streaming Multiprocessor (SM) ...
Read more >
NVRTCError: NVRTC_ERROR_COMPILATION (6) #17 - GitHub
Hi, I run into NVRTC compilation errors when trying to run cupyimg. I have an otherwise working cupy environment with cupy version 9.0.0b3....
Read more >
Maxwell (microarchitecture) - Wikipedia
Maxwell is the codename for a GPU microarchitecture developed by Nvidia as the successor to the Kepler microarchitecture. The Maxwell architecture was ...
Read more >
Table of supported GPUs - Maxwell Documentation - Next Limit
The support of the different cards is based on the version of the CUDA SDK included in Maxwell, which is 10.1; This table...
Read more >
MSI Afterburner Settings Explained / AMD and NVIDIA!
00:00 Intro01:36 Settings Explanations04:48 NVIDIA Specific18:25 AMD SpecificLearn about our WORLDWIDE GPU GIVEAWAY here!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found