Skip to content

"Device" is not a known attribute of module "pycuda.driver". Pycuda 2025.1.1 #482

Description

@sdima75

Hello.

I have:
Name: pycuda
Version: 2025.1.1

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Tue_Feb_27_16:28:36_Pacific_Standard_Time_2024
Cuda compilation tools, release 12.4, V12.4.99
Build cuda_12.4.r12.4/compiler.33961263_0

Python 3.12.8

nvidia-smi
Sat Jun 21 20:00:05 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 551.61 Driver Version: 551.61 CUDA Version: 12.4 |
|-----------------------------------------+--------------------- ---+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3050 ... WDDM | 00000000:01:00.0 On | N/A |
| N/A 36C P8 7W / 60W | 519MiB / 4096MiB | 8% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

When I enter the lines, I get errors:
import pycuda.driver as drv
drv.init() #“init” is not a known attribute of module “pycuda.driver”
print(drv.Device.count()) # “Device” is not a known attribute of module “pycuda.driver”

Please advise on how to solve the problem.
Perhaps install Python 10 or roll back nvcc to version 12.01 (as suggested by AI).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions