We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add NVCC path and Python version to show_config


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `cupyx/_runtime.py`
Content:
```
1 import inspect
2 import io
3 import os
4 import platform
5 
6 import numpy
7 
8 import cupy
9 import cupy_backends
10 
11 try:
12     import cupy.cuda.thrust as thrust
13 except ImportError:
14     thrust = None
15 
16 try:
17     import cupy_backends.cuda.libs.cudnn as cudnn
18 except ImportError:
19     cudnn = None
20 
21 try:
22     import cupy_backends.cuda.libs.nccl as nccl
23 except ImportError:
24     nccl = None
25 
26 try:
27     import cupy.cuda.cub as cub
28 except ImportError:
29     cub = None
30 
31 try:
32     import cupy.cuda.jitify as jitify
33 except ImportError:
34     jitify = None
35 
36 try:
37     import cupy_backends.cuda.libs.cutensor as cutensor
38 except ImportError:
39     cutensor = None
40 
41 try:
42     import cupy_backends.cuda.libs.cusparselt as cusparselt
43 except ImportError:
44     cusparselt = None
45 
46 try:
47     import scipy
48 except ImportError:
49     scipy = None
50 
51 try:
52     import Cython
53 except ImportError:
54     Cython = None
55 
56 is_hip = cupy_backends.cuda.api.runtime.is_hip
57 
58 
59 def _eval_or_error(func, errors):
60     # Evaluates `func` and return the result.
61     # If an error specified by `errors` occured, it returns a string
62     # representing the error.
63     try:
64         return func()
65     except errors as e:
66         return repr(e)
67 
68 
69 class _InstallInfo(object):
70 
71     # TODO(niboshi): Add is_binary_distribution
72 
73     def __init__(self):
74         cupy_package_root = self._get_cupy_package_root()
75         if cupy_package_root is not None:
76             data_root = os.path.join(cupy_package_root, '.data')
77             data_paths = {
78                 'lib': _dir_or_none(os.path.join(data_root, 'lib')),
79                 'include': _dir_or_none(os.path.join(data_root, 'include')),
80             }
81         else:
82             data_paths = {
83                 'lib': None,
84                 'include': None,
85             }
86 
87         self.cupy_package_root = cupy_package_root
88         self.data_paths = data_paths
89 
90     def get_data_path(self, data_type):
91         if data_type not in self.data_paths:
92             raise ValueError('Invalid data type: {}'.format(data_type))
93         return self.data_paths[data_type]
94 
95     def _get_cupy_package_root(self):
96         try:
97             cupy_path = inspect.getfile(cupy)
98         except TypeError:
99             return None
100         return os.path.dirname(cupy_path)
101 
102 
103 class _RuntimeInfo(object):
104 
105     cupy_version = None
106     cuda_path = None
107 
108     # CUDA Driver
109     cuda_build_version = None
110     cuda_driver_version = None
111 
112     # CUDA Runtime
113     cuda_runtime_version = None
114 
115     # CUDA Toolkit
116     cublas_version = None
117     cufft_version = None
118     curand_version = None
119     cusolver_version = None
120     cusparse_version = None
121     nvrtc_version = None
122     thrust_version = None
123 
124     # Optional Libraries
125     cudnn_build_version = None
126     cudnn_version = None
127     nccl_build_version = None
128     nccl_runtime_version = None
129     cub_build_version = None
130     jitify_build_version = None
131     cutensor_version = None
132     cusparselt_version = None
133     cython_build_version = None
134     cython_version = None
135 
136     numpy_version = None
137     scipy_version = None
138 
139     def __init__(self):
140         self.cupy_version = cupy.__version__
141 
142         if not is_hip:
143             self.cuda_path = cupy.cuda.get_cuda_path()
144         else:
145             self.cuda_path = cupy._environment.get_rocm_path()
146 
147         self.cuda_build_version = cupy.cuda.driver.get_build_version()
148         self.cuda_driver_version = _eval_or_error(
149             cupy.cuda.runtime.driverGetVersion,
150             cupy.cuda.runtime.CUDARuntimeError)
151 
152         self.cuda_runtime_version = _eval_or_error(
153             cupy.cuda.runtime.runtimeGetVersion,
154             cupy.cuda.runtime.CUDARuntimeError)
155 
156         self.cublas_version = _eval_or_error(
157             lambda: cupy.cuda.cublas.getVersion(
158                 cupy.cuda.device.get_cublas_handle()),
159             cupy.cuda.cublas.CUBLASError)
160         self.cufft_version = _eval_or_error(
161             cupy.cuda.cufft.getVersion,
162             cupy.cuda.cufft.CuFFTError)
163         self.curand_version = _eval_or_error(
164             cupy.cuda.curand.getVersion,
165             cupy.cuda.curand.CURANDError)
166         self.cusolver_version = _eval_or_error(
167             cupy.cuda.cusolver._getVersion,
168             cupy.cuda.cusolver.CUSOLVERError)
169         self.cusparse_version = _eval_or_error(
170             lambda: cupy.cuda.cusparse.getVersion(
171                 cupy.cuda.device.get_cusparse_handle()),
172             cupy.cuda.cusparse.CuSparseError)
173         self.nvrtc_version = _eval_or_error(
174             cupy.cuda.nvrtc.getVersion,
175             cupy.cuda.nvrtc.NVRTCError)
176 
177         if thrust is not None:
178             self.thrust_version = thrust.get_build_version()
179 
180         if cudnn is not None:
181             self.cudnn_build_version = cudnn.get_build_version()
182             self.cudnn_version = _eval_or_error(
183                 cudnn.getVersion, cudnn.CuDNNError)
184 
185         if nccl is not None:
186             self.nccl_build_version = nccl.get_build_version()
187             nccl_runtime_version = nccl.get_version()
188             if nccl_runtime_version == 0:
189                 nccl_runtime_version = '(unknown)'
190             self.nccl_runtime_version = nccl_runtime_version
191 
192         if cub is not None:
193             self.cub_build_version = cub.get_build_version()
194 
195         if jitify is not None:
196             self.jitify_build_version = jitify.get_build_version()
197 
198         if cutensor is not None:
199             self.cutensor_version = cutensor.get_version()
200 
201         if cusparselt is not None:
202             self.cusparselt_version = cusparselt.get_build_version()
203 
204         self.cython_build_version = cupy._util.cython_build_ver
205         if Cython is not None:
206             self.cython_version = Cython.__version__
207 
208         self.numpy_version = numpy.version.full_version
209         if scipy is not None:
210             self.scipy_version = scipy.version.full_version
211 
212     def __str__(self):
213         records = [
214             ('OS',  platform.platform()),
215             ('CuPy Version', self.cupy_version),
216             ('NumPy Version', self.numpy_version),
217             ('SciPy Version', self.scipy_version),
218             ('Cython Build Version', self.cython_build_version),
219             ('Cython Runtime Version', self.cython_version),
220             ('CUDA Root', self.cuda_path),
221 
222             ('CUDA Build Version', self.cuda_build_version),
223             ('CUDA Driver Version', self.cuda_driver_version),
224 
225             ('CUDA Runtime Version', self.cuda_runtime_version),
226         ]
227 
228         records += [
229             ('cuBLAS Version', self.cublas_version),
230             ('cuFFT Version', self.cufft_version),
231             ('cuRAND Version', self.curand_version),
232             ('cuSOLVER Version', self.cusolver_version),
233             ('cuSPARSE Version', self.cusparse_version),
234             ('NVRTC Version', self.nvrtc_version),
235             ('Thrust Version', self.thrust_version),
236             ('CUB Build Version', self.cub_build_version),
237             ('Jitify Build Version', self.jitify_build_version),
238         ]
239 
240         records += [
241             ('cuDNN Build Version', self.cudnn_build_version),
242             ('cuDNN Version', self.cudnn_version),
243             ('NCCL Build Version', self.nccl_build_version),
244             ('NCCL Runtime Version', self.nccl_runtime_version),
245             ('cuTENSOR Version', self.cutensor_version),
246             ('cuSPARSELt Build Version', self.cusparselt_version),
247         ]
248 
249         for device_id in range(cupy.cuda.runtime.getDeviceCount()):
250             with cupy.cuda.Device(device_id) as device:
251                 props = cupy.cuda.runtime.getDeviceProperties(device_id)
252                 name = ('Device {} Name'.format(device_id),
253                         props['name'].decode())
254                 pci_bus = ('Device {} PCI Bus ID'.format(device_id),
255                            device.pci_bus_id)
256                 if is_hip:
257                     try:
258                         arch = props['gcnArchName'].decode()
259                     except KeyError:  # ROCm < 3.6.0
260                         arch = 'gfx'+str(props['gcnArch'])
261                     arch = ('Device {} Arch'.format(device_id), arch)
262                 else:
263                     arch = ('Device {} Compute Capability'.format(device_id),
264                             device.compute_capability)
265                 records += [name, arch, pci_bus]
266 
267         width = max([len(r[0]) for r in records]) + 2
268         fmt = '{:' + str(width) + '}: {}\n'
269         s = io.StringIO()
270         for k, v in records:
271             s.write(fmt.format(k, v))
272 
273         return s.getvalue()
274 
275 
276 def get_runtime_info():
277     return _RuntimeInfo()
278 
279 
280 def get_install_info():
281     return _InstallInfo()
282 
283 
284 def _dir_or_none(path):
285     """Returns None if path does not exist."""
286     if os.path.isdir(path):
287         return path
288     return None
289
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/cupyx/_runtime.py b/cupyx/_runtime.py
--- a/cupyx/_runtime.py
+++ b/cupyx/_runtime.py
@@ -144,6 +144,11 @@
         else:
             self.cuda_path = cupy._environment.get_rocm_path()
 
+        if not is_hip:
+            self.nvcc_path = cupy._environment.get_nvcc_path()
+        else:
+            self.nvcc_path = cupy._environment.get_hipcc_path()
+
         self.cuda_build_version = cupy.cuda.driver.get_build_version()
         self.cuda_driver_version = _eval_or_error(
             cupy.cuda.runtime.driverGetVersion,
@@ -212,12 +217,15 @@
     def __str__(self):
         records = [
             ('OS',  platform.platform()),
+            ('Python Version', platform.python_version()),
             ('CuPy Version', self.cupy_version),
+            ('CuPy Platform', 'NVIDIA CUDA' if not is_hip else 'AMD ROCm'),
             ('NumPy Version', self.numpy_version),
             ('SciPy Version', self.scipy_version),
             ('Cython Build Version', self.cython_build_version),
             ('Cython Runtime Version', self.cython_version),
             ('CUDA Root', self.cuda_path),
+            ('hipcc PATH' if is_hip else 'nvcc PATH', self.nvcc_path),
 
             ('CUDA Build Version', self.cuda_build_version),
             ('CUDA Driver Version', self.cuda_driver_version),

{"golden_diff": "diff --git a/cupyx/_runtime.py b/cupyx/_runtime.py\n--- a/cupyx/_runtime.py\n+++ b/cupyx/_runtime.py\n@@ -144,6 +144,11 @@\n         else:\n             self.cuda_path = cupy._environment.get_rocm_path()\n \n+        if not is_hip:\n+            self.nvcc_path = cupy._environment.get_nvcc_path()\n+        else:\n+            self.nvcc_path = cupy._environment.get_hipcc_path()\n+\n         self.cuda_build_version = cupy.cuda.driver.get_build_version()\n         self.cuda_driver_version = _eval_or_error(\n             cupy.cuda.runtime.driverGetVersion,\n@@ -212,12 +217,15 @@\n     def __str__(self):\n         records = [\n             ('OS',  platform.platform()),\n+            ('Python Version', platform.python_version()),\n             ('CuPy Version', self.cupy_version),\n+            ('CuPy Platform', 'NVIDIA CUDA' if not is_hip else 'AMD ROCm'),\n             ('NumPy Version', self.numpy_version),\n             ('SciPy Version', self.scipy_version),\n             ('Cython Build Version', self.cython_build_version),\n             ('Cython Runtime Version', self.cython_version),\n             ('CUDA Root', self.cuda_path),\n+            ('hipcc PATH' if is_hip else 'nvcc PATH', self.nvcc_path),\n \n             ('CUDA Build Version', self.cuda_build_version),\n             ('CUDA Driver Version', self.cuda_driver_version),\n", "issue": "Add NVCC path and Python version to show_config\n\n", "before_files": [{"content": "import inspect\nimport io\nimport os\nimport platform\n\nimport numpy\n\nimport cupy\nimport cupy_backends\n\ntry:\n    import cupy.cuda.thrust as thrust\nexcept ImportError:\n    thrust = None\n\ntry:\n    import cupy_backends.cuda.libs.cudnn as cudnn\nexcept ImportError:\n    cudnn = None\n\ntry:\n    import cupy_backends.cuda.libs.nccl as nccl\nexcept ImportError:\n    nccl = None\n\ntry:\n    import cupy.cuda.cub as cub\nexcept ImportError:\n    cub = None\n\ntry:\n    import cupy.cuda.jitify as jitify\nexcept ImportError:\n    jitify = None\n\ntry:\n    import cupy_backends.cuda.libs.cutensor as cutensor\nexcept ImportError:\n    cutensor = None\n\ntry:\n    import cupy_backends.cuda.libs.cusparselt as cusparselt\nexcept ImportError:\n    cusparselt = None\n\ntry:\n    import scipy\nexcept ImportError:\n    scipy = None\n\ntry:\n    import Cython\nexcept ImportError:\n    Cython = None\n\nis_hip = cupy_backends.cuda.api.runtime.is_hip\n\n\ndef _eval_or_error(func, errors):\n    # Evaluates `func` and return the result.\n    # If an error specified by `errors` occured, it returns a string\n    # representing the error.\n    try:\n        return func()\n    except errors as e:\n        return repr(e)\n\n\nclass _InstallInfo(object):\n\n    # TODO(niboshi): Add is_binary_distribution\n\n    def __init__(self):\n        cupy_package_root = self._get_cupy_package_root()\n        if cupy_package_root is not None:\n            data_root = os.path.join(cupy_package_root, '.data')\n            data_paths = {\n                'lib': _dir_or_none(os.path.join(data_root, 'lib')),\n                'include': _dir_or_none(os.path.join(data_root, 'include')),\n            }\n        else:\n            data_paths = {\n                'lib': None,\n                'include': None,\n            }\n\n        self.cupy_package_root = cupy_package_root\n        self.data_paths = data_paths\n\n    def get_data_path(self, data_type):\n        if data_type not in self.data_paths:\n            raise ValueError('Invalid data type: {}'.format(data_type))\n        return self.data_paths[data_type]\n\n    def _get_cupy_package_root(self):\n        try:\n            cupy_path = inspect.getfile(cupy)\n        except TypeError:\n            return None\n        return os.path.dirname(cupy_path)\n\n\nclass _RuntimeInfo(object):\n\n    cupy_version = None\n    cuda_path = None\n\n    # CUDA Driver\n    cuda_build_version = None\n    cuda_driver_version = None\n\n    # CUDA Runtime\n    cuda_runtime_version = None\n\n    # CUDA Toolkit\n    cublas_version = None\n    cufft_version = None\n    curand_version = None\n    cusolver_version = None\n    cusparse_version = None\n    nvrtc_version = None\n    thrust_version = None\n\n    # Optional Libraries\n    cudnn_build_version = None\n    cudnn_version = None\n    nccl_build_version = None\n    nccl_runtime_version = None\n    cub_build_version = None\n    jitify_build_version = None\n    cutensor_version = None\n    cusparselt_version = None\n    cython_build_version = None\n    cython_version = None\n\n    numpy_version = None\n    scipy_version = None\n\n    def __init__(self):\n        self.cupy_version = cupy.__version__\n\n        if not is_hip:\n            self.cuda_path = cupy.cuda.get_cuda_path()\n        else:\n            self.cuda_path = cupy._environment.get_rocm_path()\n\n        self.cuda_build_version = cupy.cuda.driver.get_build_version()\n        self.cuda_driver_version = _eval_or_error(\n            cupy.cuda.runtime.driverGetVersion,\n            cupy.cuda.runtime.CUDARuntimeError)\n\n        self.cuda_runtime_version = _eval_or_error(\n            cupy.cuda.runtime.runtimeGetVersion,\n            cupy.cuda.runtime.CUDARuntimeError)\n\n        self.cublas_version = _eval_or_error(\n            lambda: cupy.cuda.cublas.getVersion(\n                cupy.cuda.device.get_cublas_handle()),\n            cupy.cuda.cublas.CUBLASError)\n        self.cufft_version = _eval_or_error(\n            cupy.cuda.cufft.getVersion,\n            cupy.cuda.cufft.CuFFTError)\n        self.curand_version = _eval_or_error(\n            cupy.cuda.curand.getVersion,\n            cupy.cuda.curand.CURANDError)\n        self.cusolver_version = _eval_or_error(\n            cupy.cuda.cusolver._getVersion,\n            cupy.cuda.cusolver.CUSOLVERError)\n        self.cusparse_version = _eval_or_error(\n            lambda: cupy.cuda.cusparse.getVersion(\n                cupy.cuda.device.get_cusparse_handle()),\n            cupy.cuda.cusparse.CuSparseError)\n        self.nvrtc_version = _eval_or_error(\n            cupy.cuda.nvrtc.getVersion,\n            cupy.cuda.nvrtc.NVRTCError)\n\n        if thrust is not None:\n            self.thrust_version = thrust.get_build_version()\n\n        if cudnn is not None:\n            self.cudnn_build_version = cudnn.get_build_version()\n            self.cudnn_version = _eval_or_error(\n                cudnn.getVersion, cudnn.CuDNNError)\n\n        if nccl is not None:\n            self.nccl_build_version = nccl.get_build_version()\n            nccl_runtime_version = nccl.get_version()\n            if nccl_runtime_version == 0:\n                nccl_runtime_version = '(unknown)'\n            self.nccl_runtime_version = nccl_runtime_version\n\n        if cub is not None:\n            self.cub_build_version = cub.get_build_version()\n\n        if jitify is not None:\n            self.jitify_build_version = jitify.get_build_version()\n\n        if cutensor is not None:\n            self.cutensor_version = cutensor.get_version()\n\n        if cusparselt is not None:\n            self.cusparselt_version = cusparselt.get_build_version()\n\n        self.cython_build_version = cupy._util.cython_build_ver\n        if Cython is not None:\n            self.cython_version = Cython.__version__\n\n        self.numpy_version = numpy.version.full_version\n        if scipy is not None:\n            self.scipy_version = scipy.version.full_version\n\n    def __str__(self):\n        records = [\n            ('OS',  platform.platform()),\n            ('CuPy Version', self.cupy_version),\n            ('NumPy Version', self.numpy_version),\n            ('SciPy Version', self.scipy_version),\n            ('Cython Build Version', self.cython_build_version),\n            ('Cython Runtime Version', self.cython_version),\n            ('CUDA Root', self.cuda_path),\n\n            ('CUDA Build Version', self.cuda_build_version),\n            ('CUDA Driver Version', self.cuda_driver_version),\n\n            ('CUDA Runtime Version', self.cuda_runtime_version),\n        ]\n\n        records += [\n            ('cuBLAS Version', self.cublas_version),\n            ('cuFFT Version', self.cufft_version),\n            ('cuRAND Version', self.curand_version),\n            ('cuSOLVER Version', self.cusolver_version),\n            ('cuSPARSE Version', self.cusparse_version),\n            ('NVRTC Version', self.nvrtc_version),\n            ('Thrust Version', self.thrust_version),\n            ('CUB Build Version', self.cub_build_version),\n            ('Jitify Build Version', self.jitify_build_version),\n        ]\n\n        records += [\n            ('cuDNN Build Version', self.cudnn_build_version),\n            ('cuDNN Version', self.cudnn_version),\n            ('NCCL Build Version', self.nccl_build_version),\n            ('NCCL Runtime Version', self.nccl_runtime_version),\n            ('cuTENSOR Version', self.cutensor_version),\n            ('cuSPARSELt Build Version', self.cusparselt_version),\n        ]\n\n        for device_id in range(cupy.cuda.runtime.getDeviceCount()):\n            with cupy.cuda.Device(device_id) as device:\n                props = cupy.cuda.runtime.getDeviceProperties(device_id)\n                name = ('Device {} Name'.format(device_id),\n                        props['name'].decode())\n                pci_bus = ('Device {} PCI Bus ID'.format(device_id),\n                           device.pci_bus_id)\n                if is_hip:\n                    try:\n                        arch = props['gcnArchName'].decode()\n                    except KeyError:  # ROCm < 3.6.0\n                        arch = 'gfx'+str(props['gcnArch'])\n                    arch = ('Device {} Arch'.format(device_id), arch)\n                else:\n                    arch = ('Device {} Compute Capability'.format(device_id),\n                            device.compute_capability)\n                records += [name, arch, pci_bus]\n\n        width = max([len(r[0]) for r in records]) + 2\n        fmt = '{:' + str(width) + '}: {}\\n'\n        s = io.StringIO()\n        for k, v in records:\n            s.write(fmt.format(k, v))\n\n        return s.getvalue()\n\n\ndef get_runtime_info():\n    return _RuntimeInfo()\n\n\ndef get_install_info():\n    return _InstallInfo()\n\n\ndef _dir_or_none(path):\n    \"\"\"Returns None if path does not exist.\"\"\"\n    if os.path.isdir(path):\n        return path\n    return None\n", "path": "cupyx/_runtime.py"}], "after_files": [{"content": "import inspect\nimport io\nimport os\nimport platform\n\nimport numpy\n\nimport cupy\nimport cupy_backends\n\ntry:\n    import cupy.cuda.thrust as thrust\nexcept ImportError:\n    thrust = None\n\ntry:\n    import cupy_backends.cuda.libs.cudnn as cudnn\nexcept ImportError:\n    cudnn = None\n\ntry:\n    import cupy_backends.cuda.libs.nccl as nccl\nexcept ImportError:\n    nccl = None\n\ntry:\n    import cupy.cuda.cub as cub\nexcept ImportError:\n    cub = None\n\ntry:\n    import cupy.cuda.jitify as jitify\nexcept ImportError:\n    jitify = None\n\ntry:\n    import cupy_backends.cuda.libs.cutensor as cutensor\nexcept ImportError:\n    cutensor = None\n\ntry:\n    import cupy_backends.cuda.libs.cusparselt as cusparselt\nexcept ImportError:\n    cusparselt = None\n\ntry:\n    import scipy\nexcept ImportError:\n    scipy = None\n\ntry:\n    import Cython\nexcept ImportError:\n    Cython = None\n\nis_hip = cupy_backends.cuda.api.runtime.is_hip\n\n\ndef _eval_or_error(func, errors):\n    # Evaluates `func` and return the result.\n    # If an error specified by `errors` occured, it returns a string\n    # representing the error.\n    try:\n        return func()\n    except errors as e:\n        return repr(e)\n\n\nclass _InstallInfo(object):\n\n    # TODO(niboshi): Add is_binary_distribution\n\n    def __init__(self):\n        cupy_package_root = self._get_cupy_package_root()\n        if cupy_package_root is not None:\n            data_root = os.path.join(cupy_package_root, '.data')\n            data_paths = {\n                'lib': _dir_or_none(os.path.join(data_root, 'lib')),\n                'include': _dir_or_none(os.path.join(data_root, 'include')),\n            }\n        else:\n            data_paths = {\n                'lib': None,\n                'include': None,\n            }\n\n        self.cupy_package_root = cupy_package_root\n        self.data_paths = data_paths\n\n    def get_data_path(self, data_type):\n        if data_type not in self.data_paths:\n            raise ValueError('Invalid data type: {}'.format(data_type))\n        return self.data_paths[data_type]\n\n    def _get_cupy_package_root(self):\n        try:\n            cupy_path = inspect.getfile(cupy)\n        except TypeError:\n            return None\n        return os.path.dirname(cupy_path)\n\n\nclass _RuntimeInfo(object):\n\n    cupy_version = None\n    cuda_path = None\n\n    # CUDA Driver\n    cuda_build_version = None\n    cuda_driver_version = None\n\n    # CUDA Runtime\n    cuda_runtime_version = None\n\n    # CUDA Toolkit\n    cublas_version = None\n    cufft_version = None\n    curand_version = None\n    cusolver_version = None\n    cusparse_version = None\n    nvrtc_version = None\n    thrust_version = None\n\n    # Optional Libraries\n    cudnn_build_version = None\n    cudnn_version = None\n    nccl_build_version = None\n    nccl_runtime_version = None\n    cub_build_version = None\n    jitify_build_version = None\n    cutensor_version = None\n    cusparselt_version = None\n    cython_build_version = None\n    cython_version = None\n\n    numpy_version = None\n    scipy_version = None\n\n    def __init__(self):\n        self.cupy_version = cupy.__version__\n\n        if not is_hip:\n            self.cuda_path = cupy.cuda.get_cuda_path()\n        else:\n            self.cuda_path = cupy._environment.get_rocm_path()\n\n        if not is_hip:\n            self.nvcc_path = cupy._environment.get_nvcc_path()\n        else:\n            self.nvcc_path = cupy._environment.get_hipcc_path()\n\n        self.cuda_build_version = cupy.cuda.driver.get_build_version()\n        self.cuda_driver_version = _eval_or_error(\n            cupy.cuda.runtime.driverGetVersion,\n            cupy.cuda.runtime.CUDARuntimeError)\n\n        self.cuda_runtime_version = _eval_or_error(\n            cupy.cuda.runtime.runtimeGetVersion,\n            cupy.cuda.runtime.CUDARuntimeError)\n\n        self.cublas_version = _eval_or_error(\n            lambda: cupy.cuda.cublas.getVersion(\n                cupy.cuda.device.get_cublas_handle()),\n            cupy.cuda.cublas.CUBLASError)\n        self.cufft_version = _eval_or_error(\n            cupy.cuda.cufft.getVersion,\n            cupy.cuda.cufft.CuFFTError)\n        self.curand_version = _eval_or_error(\n            cupy.cuda.curand.getVersion,\n            cupy.cuda.curand.CURANDError)\n        self.cusolver_version = _eval_or_error(\n            cupy.cuda.cusolver._getVersion,\n            cupy.cuda.cusolver.CUSOLVERError)\n        self.cusparse_version = _eval_or_error(\n            lambda: cupy.cuda.cusparse.getVersion(\n                cupy.cuda.device.get_cusparse_handle()),\n            cupy.cuda.cusparse.CuSparseError)\n        self.nvrtc_version = _eval_or_error(\n            cupy.cuda.nvrtc.getVersion,\n            cupy.cuda.nvrtc.NVRTCError)\n\n        if thrust is not None:\n            self.thrust_version = thrust.get_build_version()\n\n        if cudnn is not None:\n            self.cudnn_build_version = cudnn.get_build_version()\n            self.cudnn_version = _eval_or_error(\n                cudnn.getVersion, cudnn.CuDNNError)\n\n        if nccl is not None:\n            self.nccl_build_version = nccl.get_build_version()\n            nccl_runtime_version = nccl.get_version()\n            if nccl_runtime_version == 0:\n                nccl_runtime_version = '(unknown)'\n            self.nccl_runtime_version = nccl_runtime_version\n\n        if cub is not None:\n            self.cub_build_version = cub.get_build_version()\n\n        if jitify is not None:\n            self.jitify_build_version = jitify.get_build_version()\n\n        if cutensor is not None:\n            self.cutensor_version = cutensor.get_version()\n\n        if cusparselt is not None:\n            self.cusparselt_version = cusparselt.get_build_version()\n\n        self.cython_build_version = cupy._util.cython_build_ver\n        if Cython is not None:\n            self.cython_version = Cython.__version__\n\n        self.numpy_version = numpy.version.full_version\n        if scipy is not None:\n            self.scipy_version = scipy.version.full_version\n\n    def __str__(self):\n        records = [\n            ('OS',  platform.platform()),\n            ('Python Version', platform.python_version()),\n            ('CuPy Version', self.cupy_version),\n            ('CuPy Platform', 'NVIDIA CUDA' if not is_hip else 'AMD ROCm'),\n            ('NumPy Version', self.numpy_version),\n            ('SciPy Version', self.scipy_version),\n            ('Cython Build Version', self.cython_build_version),\n            ('Cython Runtime Version', self.cython_version),\n            ('CUDA Root', self.cuda_path),\n            ('hipcc PATH' if is_hip else 'nvcc PATH', self.nvcc_path),\n\n            ('CUDA Build Version', self.cuda_build_version),\n            ('CUDA Driver Version', self.cuda_driver_version),\n\n            ('CUDA Runtime Version', self.cuda_runtime_version),\n        ]\n\n        records += [\n            ('cuBLAS Version', self.cublas_version),\n            ('cuFFT Version', self.cufft_version),\n            ('cuRAND Version', self.curand_version),\n            ('cuSOLVER Version', self.cusolver_version),\n            ('cuSPARSE Version', self.cusparse_version),\n            ('NVRTC Version', self.nvrtc_version),\n            ('Thrust Version', self.thrust_version),\n            ('CUB Build Version', self.cub_build_version),\n            ('Jitify Build Version', self.jitify_build_version),\n        ]\n\n        records += [\n            ('cuDNN Build Version', self.cudnn_build_version),\n            ('cuDNN Version', self.cudnn_version),\n            ('NCCL Build Version', self.nccl_build_version),\n            ('NCCL Runtime Version', self.nccl_runtime_version),\n            ('cuTENSOR Version', self.cutensor_version),\n            ('cuSPARSELt Build Version', self.cusparselt_version),\n        ]\n\n        for device_id in range(cupy.cuda.runtime.getDeviceCount()):\n            with cupy.cuda.Device(device_id) as device:\n                props = cupy.cuda.runtime.getDeviceProperties(device_id)\n                name = ('Device {} Name'.format(device_id),\n                        props['name'].decode())\n                pci_bus = ('Device {} PCI Bus ID'.format(device_id),\n                           device.pci_bus_id)\n                if is_hip:\n                    try:\n                        arch = props['gcnArchName'].decode()\n                    except KeyError:  # ROCm < 3.6.0\n                        arch = 'gfx'+str(props['gcnArch'])\n                    arch = ('Device {} Arch'.format(device_id), arch)\n                else:\n                    arch = ('Device {} Compute Capability'.format(device_id),\n                            device.compute_capability)\n                records += [name, arch, pci_bus]\n\n        width = max([len(r[0]) for r in records]) + 2\n        fmt = '{:' + str(width) + '}: {}\\n'\n        s = io.StringIO()\n        for k, v in records:\n            s.write(fmt.format(k, v))\n\n        return s.getvalue()\n\n\ndef get_runtime_info():\n    return _RuntimeInfo()\n\n\ndef get_install_info():\n    return _InstallInfo()\n\n\ndef _dir_or_none(path):\n    \"\"\"Returns None if path does not exist.\"\"\"\n    if os.path.isdir(path):\n        return path\n    return None\n", "path": "cupyx/_runtime.py"}]}