Giter Site home page Giter Site logo

Pycuda import error about ganspace HOT 7 OPEN

harskish avatar harskish commented on May 16, 2024
Pycuda import error

from ganspace.

Comments (7)

MineThingIssues avatar MineThingIssues commented on May 16, 2024

You have to install PyCuda yourself, and make sure that when you run configure.py you enable OpenGL, as that is required for this to work. Instructions can be found here: https://wiki.tiker.net/PyCuda/Installation

from ganspace.

natoucs-datagen avatar natoucs-datagen commented on May 16, 2024

Thanks!
I managed to install PyCuda through the pip module inside the conda environment.

anaconda/envs/ganspace/bin/pip install pycuda

However this leads to:

ImportError: PyCUDA was compiled without GL extension support

I am not sure how to add GL extension support with the PyCuda installed through pip.
So I will try what you suggested.

from ganspace.

natoucs-datagen avatar natoucs-datagen commented on May 16, 2024

So I managed to install from your link @MineThingIssues.
And I used:
python configure.py --cuda-root=/usr/local/cuda --cuda-enable-gl
to make sure OpenGL is used.
I did all the steps while keeping my conda env active and then I ran and passed all the unittests in the pycuda /test folder.
However I still get the same error.

Somebody knows why ?

from ganspace.

natoucs-datagen avatar natoucs-datagen commented on May 16, 2024

Ok I managed to install PyCuda inside the conda environment, deleted PyCuda files from the previous pip install there and succesfully ran interactive.py.

from ganspace.

natoucs-datagen avatar natoucs-datagen commented on May 16, 2024

Actually now that I have solved some other bugs which where blocking execution and not related to PyCuda, I get:

RuntimeError: make_default_context() wasn't able to create a context on any of the 2 detected devices

This is when running interactive.py.
System details:
2 GPUs GeForce RTX
NVIDIA-SMI 440.64.00 | Driver Version: 440.64.00 | CUDA Version: 10.2
CentOS Linux 8

Anybody went through this and was able to solve it ?

from ganspace.

martindisley avatar martindisley commented on May 16, 2024

I'm having also having some trouble installing PYCUDA correctly.

I followed instructions from @MineThingIssues + @natoucs-datagen above.
cd pycuda-2019.1.2/
python configure.py --cuda-root=/usr/local/cuda --cuda-enable-gl
sudo su -c 'make install

It seemed to install correctly (no errors), but I'm still getting this:

Traceback (most recent call last):
  File "interactive.py", line 26, in <module>
    from TkTorchWindow import TorchImageView
  File "/home/martin/workspace/ganspace/TkTorchWindow.py", line 16, in <module>
    from pycuda.gl import graphics_map_flags
  File "/home/martin/anaconda3/envs/ganspace/lib/python3.7/site-packages/pycuda/gl/__init__.py", line 5, in <module>
    raise ImportError("PyCUDA was compiled without GL extension support")
ImportError: PyCUDA was compiled without GL extension support

I previously installed PYCUDA via conda (because su -c "make install" failed for me unless I ran it sudo). Is it possible that it's getting confused between the two versions installed? i.e do I have to remove the env and repo and start again?

from ganspace.

DarkGeekMS avatar DarkGeekMS commented on May 16, 2024

In case you still have the same issue :

  • Remove pycuda :
pip uninstall pycuda
  • set CUDA_ENABLE_GL = True in siteconf.py.

  • Rebuild pycuda with sudo make install.

This works for me!

from ganspace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.