Code Monkey home page Code Monkey logo

Comments (13)

f0k avatar f0k commented on May 13, 2024 2

Clearly nvcc compiler is not the path, then I tried PATH = PATH + ":/usr/local/cuda-7.5/bin", it still doesn't work

This doesn't change where nvcc is searched for, that PATH is just a backup of the environment variable to avoid Anaconda sneaking in a wrong MSVC version on Windows. You'd need to modify os.environ['PATH'], or just change your PATH environment variable. Did you restart your terminal after changing the .bashrc? You can try echo $PATH to see if the path is correct.

Note that when you're using sudo, the PATH will be overridden, no matter what you set it to. You can do sudo PATH="$PATH" ... to have the environment carry over.

from cudamat.

scttl avatar scttl commented on May 13, 2024

Per the installation instructions were you trying to install system-wide via sudo or just under your user directory?

Can you also supply the permissions of nvcc as well? The output of either sudo ls -l $(which nvcc) or ls -l $(which nvcc) depending on the type of install you're attempting should do the trick.

from cudamat.

flavianh avatar flavianh commented on May 13, 2024

I tried both!

$ sudo ls -l $(which nvcc)
-rwxr-xr-x 1 root root 209624 Nov 26 09:56 /usr/local/cuda-6.5/bin/nvcc

from cudamat.

f0k avatar f0k commented on May 13, 2024

Interesting. For me it installs fine under Ubuntu 14.04 and CUDA 6.5. Why does your shell find nvcc and setuptools doesn't? Did you add /usr/local/cuda/bin (or /usr/local/cuda-6.5/bin) to your PATH environment variable? Can you add a print 'PATH =', os.environ.get('PATH') line to the top of the setup.py file to check (after the imports)?

from cudamat.

flavianh avatar flavianh commented on May 13, 2024

Yes, cuda is in PATH. Plus otherwise it would not compile when I call make on your previous commit.

from cudamat.

f0k avatar f0k commented on May 13, 2024

Still:

Can you add a print 'PATH =', os.environ.get('PATH') line to the top of the setup.py file to check (after the imports)?

There must be something different. Unless we're misinterpreting the error message and it finds nvcc, but nvcc is missing something.

from cudamat.

scttl avatar scttl commented on May 13, 2024

One other thing that would help us try and track down the source of the error would be to add '--verbose' to the nvcc_compile_args list in setup.py. Then try to install again, and paste the full output of that command.

from cudamat.

flavianh avatar flavianh commented on May 13, 2024

I did not see you meant in the setup.py. I just did it, cuda is not inside.
This is because I modified the PATH environment variable inside my user's .bashrc file. The CUDA post installation notes tell you to add the environment variables manually here.
It works fine now!

from cudamat.

TheodoreG avatar TheodoreG commented on May 13, 2024

When I add the print 'PATH =', os.environ.get('PATH') line to the setup.py, it shows /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.Clearly nvcc compiler is not the path, then I tried PATH = PATH + ":/usr/local/cuda-7.5/bin", it still doesn't work and still shows unable to execute 'nvcc': No such file or directory, what should I do? I've already add the nvcc path to the .bashrc file.

from cudamat.

TheodoreG avatar TheodoreG commented on May 13, 2024

from cudamat.

0ut0fcontrol avatar 0ut0fcontrol commented on May 13, 2024

Try not run python in the directory "cudamat".
This is some lines in INSTALL.md

cd test  # so it doesn't try importing cudamat from the source directory
# Run tests
nosetests
# Run benchmark
python ../examples/bench_cudamat.py

from cudamat.

nateGeorge avatar nateGeorge commented on May 13, 2024

@flavianh I don't know how you got it to work, even with nvcc in my sudo and user path, it wouldn't work. I had to change the lines:

class CUDA_build_ext(build_ext):
    """
    Custom build_ext command that compiles CUDA files.
    Note that all extension source files will be processed with this compiler.
    """
    def build_extensions(self):
        self.compiler.src_extensions.append('.cu')
        self.compiler.set_executable('compiler_so', 'nvcc')
        self.compiler.set_executable('linker_so', 'nvcc --shared')
        if hasattr(self.compiler, '_c_extensions'):
            self.compiler._c_extensions.append('.cu')  # needed for Windows
        self.compiler.spawn = self.spawn
        build_ext.build_extensions(self)

to

class CUDA_build_ext(build_ext):
    """
    Custom build_ext command that compiles CUDA files.
    Note that all extension source files will be processed with this compiler.
    """
    def build_extensions(self):
        self.compiler.src_extensions.append('.cu')
        self.compiler.set_executable('compiler_so', '/usr/local/cuda/bin/nvcc')
        self.compiler.set_executable('linker_so', '/usr/local/cuda/bin/nvcc --shared')
        if hasattr(self.compiler, '_c_extensions'):
            self.compiler._c_extensions.append('.cu')  # needed for Windows
        self.compiler.spawn = self.spawn
        build_ext.build_extensions(self)

Note that I had to provide the full path to nvcc for it to work.

from cudamat.

f0k avatar f0k commented on May 13, 2024

@nateGeorge: What about pip install http://github.com/f0k/cudamat/archive/simplify-compile.zip, does this fail as well? It's a little different, but not sure if this would help. Did you try installing with sudo or without?

from cudamat.

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.