Paul Klemm
Paul Klemm

Reputation: 265

gputools install failed - "Unknown option 'framework'"

I've struggling to install the r package gputools on my machine. I've installed CUDA and set the correspoding PATH files correctly as said here.

When compiling the package I initially got the error

/usr/local/cuda/bin/nvcc -gencode arch=compute_10,code=sm_10 -gencode arch=compute_13,code=sm_13 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -c -I. -I"/usr/local/cuda/include" -I"/usr/local/Cellar/r/3.1.0/R.framework/Resources/include" -m64 -Xcompiler -fPIC rinterface.cu -o rinterface.o
nvcc fatal   : Unsupported gpu architecture 'compute_10'

I solved this by removing the -gencode arch=compute_10,code=sm_10 from the gputools makefile (found this simple solution here).

Now it compiles some stuff for about 30 seconds and then ends with the following error:

/usr/local/cuda/bin/nvcc -gencode arch=compute_13,code=sm_13 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -shared -m64 -Xlinker '-rpath /usr/local/cuda/lib -F/usr/local/Cellar/r/3.1.0/R.framework/Resources/.. -framework R' -L"/usr/local/Cellar/r/3.1.0/R.framework/Resources/lib" -L"/usr/local/cuda/lib" -lcublas -framework Accelerate rinterface.o mi.o sort.o granger.o qrdecomp.o correlation.o hcluster.o distance.o matmult.o lsfit.o kendall.o cuseful.o -o gputools.so
nvcc fatal   : Unknown option 'framework'
make: *** [gputools.so] Error 1
ERROR: compilation failed for package ‘gputools’
* removing ‘/usr/local/Cellar/r/3.1.0/R.framework/Versions/3.1/Resources/library/gputools’

The complete console output can be found here. I'm lost on this one, there is only one occurence of -framework in the config.mk file, which is R_FRAMEWORK := -F$(R_HOME)/.. -framework R and even removing -framework R doesn’t make a difference.

Note: I use R CMD build gputools && R CMD INSTALL gputools_0.28.tar.gz to compile it from the repo as recommended here

Has anybody an idea what I could try?

Upvotes: 4

Views: 1025

Answers (3)

Paul Klemm
Paul Klemm

Reputation: 265

It seems that gputools 1.0 has solved my issue. I've been able to install it without problems using R 3.2.2.

platform       x86_64-apple-darwin15.0.0   
arch           x86_64                      
os             darwin15.0.0                
system         x86_64, darwin15.0.0        
status                                     
major          3                           
minor          2.2                         
year           2015                        
month          08                          
day            14                          
svn rev        69053                       
language       R                           
version.string R version 3.2.2 (2015-08-14)
nickname       Fire Safety   

Upvotes: 2

Eric Farng
Eric Farng

Reputation: 111

I also got the same "framework" error and was finally able to fix the problem. Allow me to start from the beginning. If you are getting a compile error about Unsupported gpu architecture, you can fix this by first extracting the package

tar -xzvf gputools_0.28.tar.gz

then edit the Makefile

vi gputools/src/Makefile

to the more recent architecture flags for the new nvidia compiler

-gencode arch=compute_20,code=sm_20
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=sm_50
-gencode arch=compute_52,code=sm_52
-gencode arch=compute_52,code=compute_52

You can find more details about this on NVidia's website. Remove any that continue to give compile errors.

Then put the tar.gz back together and try to install it

tar -czvf my_gputools_0.28.tar.gz gputools
R CMD build gputools && R CMD INSTALL gputools_0.28.tar.gz

Don't forget the environment variables that are talked about in the package documentation

export CUDA_HOME=/usr/local/cuda/5.0
export LD_LIBRARY_PATH=/usr/local/cuda/5.0/lib64:$LD_LIBRARY_PATH`

At this point, if you get a Unknown option 'framework' exception, it seems that the nvcc command line parameter has changed slightly. Look again in the makefile and look for ${shell R CMD config BLAS_LIBS}. This is the part that was inserting the -framework <value> parameter for me. You can test for your configuration by just running the command R CMD config BLAS_LIBS. The new command to include frameworks is

-Xlinker -framework,<value>

There is more information at this Nvidia page

Upvotes: 0

Belethia
Belethia

Reputation: 368

Sorry. I'm posting this as a solution, but I don't have enough reputation to comment. Paul, your solution worked for me. My device is a GeForce GT 750M with 3.0 CUDA capability.

I downloaded the last source gputools_0.28.tar.gz and decompressed it. Then I modified line 19 in src/Makefile:

NVCC := $(CUDA_HOME)/bin/nvcc -gencode arch=compute_10,code=sm_10 -gencode arch=compute_13,code=sm_13 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30

to look like this:

NVCC := $(CUDA_HOME)/bin/nvcc -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30

finally, installed with

R CMD INSTALL gputools

where gputools is the folder created after decompressing the source.

My R version is

platform       x86_64-apple-darwin13.4.0   
arch           x86_64                      
os             darwin13.4.0                
system         x86_64, darwin13.4.0        
status                                     
major          3                           
minor          2.2                         
year           2015                        
month          08                          
day            14                          
svn rev        69053                       
language       R                           
version.string R version 3.2.2 (2015-08-14)
nickname       Fire Safety     

Upvotes: 1

Related Questions