NVIDIA / cuda-python

CUDA Python Low-level Bindings
https://nvidia.github.io/cuda-python/
Other
809 stars 63 forks source link

21 errors during collection #39

Closed nyck33 closed 1 year ago

nyck33 commented 1 year ago
(cython) nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python$ pip install cuda-python==11.7
Requirement already satisfied: cuda-python==11.7 in /home/nyck33/anaconda3/envs/cython/lib/python3.10/site-packages (11.7.0)
Requirement already satisfied: cython in /home/nyck33/anaconda3/envs/cython/lib/python3.10/site-packages (from cuda-python==11.7) (3.0.0a11)
(cython) nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python$ python -m pytest
================================ test session starts =================================
platform linux -- Python 3.10.8, pytest-7.2.0, pluggy-1.0.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python, configfile: pytest.ini
plugins: benchmark-4.0.0
collected 12 items / 21 errors                                                       

======================================= ERRORS =======================================
______________ ERROR collecting cuda/benchmarks/test_launch_latency.py _______________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/benchmarks/test_launch_latency.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
cuda/benchmarks/test_launch_latency.py:9: in <module>
    from cuda import cuda
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
____________ ERROR collecting cuda/benchmarks/test_pointer_attributes.py _____________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/benchmarks/test_pointer_attributes.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
cuda/benchmarks/test_pointer_attributes.py:9: in <module>
    from cuda import cuda
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
______________________ ERROR collecting cuda/tests/test_cuda.py ______________________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/tests/test_cuda.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
cuda/tests/test_cuda.py:10: in <module>
    import cuda.cuda as cuda
E   ModuleNotFoundError: No module named 'cuda.cuda'
_____________________ ERROR collecting cuda/tests/test_cudart.py _____________________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/tests/test_cudart.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
cuda/tests/test_cudart.py:10: in <module>
    import cuda.cudart as cudart
E   ModuleNotFoundError: No module named 'cuda.cudart'
_____________________ ERROR collecting cuda/tests/test_cython.py _____________________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/tests/test_cython.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
cuda/tests/test_cython.py:35: in <module>
    mod = importlib.import_module(mod)
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
E   ModuleNotFoundError: No module named 'cuda.tests.test_ccuda'
________________ ERROR collecting cuda/tests/test_interoperability.py ________________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/tests/test_interoperability.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
cuda/tests/test_interoperability.py:9: in <module>
    import cuda.cuda as cuda
E   ModuleNotFoundError: No module named 'cuda.cuda'
__________________ ERROR collecting cuda/tests/test_kernelParams.py __________________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/tests/test_kernelParams.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
cuda/tests/test_kernelParams.py:9: in <module>
    from cuda import cuda, cudart, nvrtc
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
_____________________ ERROR collecting cuda/tests/test_nvrtc.py ______________________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/tests/test_nvrtc.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
cuda/tests/test_nvrtc.py:9: in <module>
    from cuda import nvrtc
E   ImportError: cannot import name 'nvrtc' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
____________ ERROR collecting examples/0_Introduction/clock_nvrtc_test.py ____________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/0_Introduction/clock_nvrtc_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/0_Introduction/clock_nvrtc_test.py:9: in <module>
    from cuda import cuda
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
_______ ERROR collecting examples/0_Introduction/simpleCubemapTexture_test.py ________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/0_Introduction/simpleCubemapTexture_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/0_Introduction/simpleCubemapTexture_test.py:13: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
_____________ ERROR collecting examples/0_Introduction/simpleP2P_test.py _____________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/0_Introduction/simpleP2P_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/0_Introduction/simpleP2P_test.py:11: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
__________ ERROR collecting examples/0_Introduction/simpleZeroCopy_test.py ___________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/0_Introduction/simpleZeroCopy_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/0_Introduction/simpleZeroCopy_test.py:13: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
_________ ERROR collecting examples/0_Introduction/systemWideAtomics_test.py _________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/0_Introduction/systemWideAtomics_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/0_Introduction/systemWideAtomics_test.py:12: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
___________ ERROR collecting examples/0_Introduction/vectorAddDrv_test.py ____________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/0_Introduction/vectorAddDrv_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/0_Introduction/vectorAddDrv_test.py:11: in <module>
    from cuda import cuda
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
___________ ERROR collecting examples/0_Introduction/vectorAddMMAP_test.py ___________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/0_Introduction/vectorAddMMAP_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/0_Introduction/vectorAddMMAP_test.py:12: in <module>
    from cuda import cuda
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
_ ERROR collecting examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py _
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py:13: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
______ ERROR collecting examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py ______
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py:13: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
_________ ERROR collecting examples/3_CUDA_Features/simpleCudaGraphs_test.py _________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/3_CUDA_Features/simpleCudaGraphs_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/3_CUDA_Features/simpleCudaGraphs_test.py:11: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
__ ERROR collecting examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py __
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py:12: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
_______________ ERROR collecting examples/extra/isoFDModelling_test.py _______________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/extra/isoFDModelling_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/extra/isoFDModelling_test.py:10: in <module>
    from cuda import cuda, cudart
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
________________ ERROR collecting examples/extra/jit_program_test.py _________________
ImportError while importing test module '/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/examples/extra/jit_program_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../anaconda3/envs/cython/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/extra/jit_program_test.py:10: in <module>
    from cuda import cuda, nvrtc
E   ImportError: cannot import name 'cuda' from 'cuda' (/home/nyck33/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python/cuda/__init__.py)
============================== short test summary info ===============================
ERROR cuda/benchmarks/test_launch_latency.py
ERROR cuda/benchmarks/test_pointer_attributes.py
ERROR cuda/tests/test_cuda.py
ERROR cuda/tests/test_cudart.py
ERROR cuda/tests/test_cython.py
ERROR cuda/tests/test_interoperability.py
ERROR cuda/tests/test_kernelParams.py
ERROR cuda/tests/test_nvrtc.py
ERROR examples/0_Introduction/clock_nvrtc_test.py
ERROR examples/0_Introduction/simpleCubemapTexture_test.py
ERROR examples/0_Introduction/simpleP2P_test.py
ERROR examples/0_Introduction/simpleZeroCopy_test.py
ERROR examples/0_Introduction/systemWideAtomics_test.py
ERROR examples/0_Introduction/vectorAddDrv_test.py
ERROR examples/0_Introduction/vectorAddMMAP_test.py
ERROR examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py
ERROR examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py
ERROR examples/3_CUDA_Features/simpleCudaGraphs_test.py
ERROR examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py
ERROR examples/extra/isoFDModelling_test.py
ERROR examples/extra/jit_program_test.py
!!!!!!!!!!!!!!!!!!!!!! Interrupted: 21 errors during collection !!!!!!!!!!!!!!!!!!!!!!
================================= 21 errors in 0.62s =================================
(cython) nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Documents/cuda-start-dec2022/cuda-python11_7/cuda-python$ 
vzhurba01 commented 1 year ago

To test your pip package, you'd need to move the tests outside of cuda-python:

cp cuda-python/examples/ .
cp -r cuda-python/examples/ .
cp -r cuda-python/cuda/tests/ .
python -m pytest tests/
python -m pytest examples/

This is a name conflict between folder structure cuda-python/cuda and the import call from cuda import cuda. Therefor importing cuda while inside cuda-python will look for locally built CUDA Python library.