Tuesday, May 11, 2021

Install a specific version of spades in conda

 

 $ conda search spades
Loading channels: done
# Name                       Version           Build  Channel             
spades                         3.5.0               1  bioconda            
spades                         3.5.0          py27_0  bioconda            
spades                         3.6.2               0  bioconda            
spades                         3.7.0               0  bioconda            
spades                         3.8.0               0  bioconda            
spades                         3.8.1               0  bioconda            
spades                         3.9.0               0  bioconda            
spades                         3.9.0               3  bioconda            
spades                         3.9.0               4  bioconda            
spades                         3.9.0          py27_1  bioconda            
spades                         3.9.0          py27_2  bioconda            
spades                         3.9.0          py34_1  bioconda            
spades                         3.9.0          py35_1  bioconda            
spades                         3.9.0          py35_2  bioconda            
spades                         3.9.1               0  bioconda            
spades                         3.9.1      h9ee0642_1  bioconda            
spades                        3.10.0          py27_0  bioconda            
spades                        3.10.0          py34_0  bioconda            
spades                        3.10.0          py35_0  bioconda            
spades                        3.10.1               1  bioconda            
spades                        3.10.1          py27_0  bioconda            
spades                        3.10.1          py34_0  bioconda            
spades                        3.10.1          py35_0  bioconda            
spades                        3.11.0          py27_0  bioconda            
spades                        3.11.0 py27_zlib1.2.8_1  bioconda            
spades                        3.11.0          py35_0  bioconda            
spades                        3.11.0 py35_zlib1.2.8_1  bioconda            
spades                        3.11.0          py36_0  bioconda            
spades                        3.11.0 py36_zlib1.2.8_1  bioconda            
spades                        3.11.1      h21aa3a5_2  bioconda            
spades                        3.11.1      h21aa3a5_3  bioconda            
spades                        3.11.1      hb7ba0dd_4  bioconda            
spades                        3.11.1 py27_zlib1.2.11_1  bioconda            
spades                        3.11.1 py27_zlib1.2.8_0  bioconda            
spades                        3.11.1 py35_zlib1.2.11_1  bioconda            
spades                        3.11.1 py35_zlib1.2.8_0  bioconda            
spades                        3.11.1 py36_zlib1.2.11_1  bioconda            
spades                        3.11.1 py36_zlib1.2.8_0  bioconda            
spades                        3.12.0               1  bioconda            
spades                        3.12.0      h9ee0642_2  bioconda            
spades                        3.12.0          py27_0  bioconda            
spades                        3.12.0          py35_0  bioconda            
spades                        3.12.0          py36_0  bioconda            
spades                        3.13.0               0  bioconda            
spades                        3.13.1               0  bioconda            
spades                        3.13.1      h2d02072_2  bioconda            
spades                        3.13.1      hfb2e325_1  bioconda            
spades                        3.13.2      h2d02072_0  bioconda            
spades                        3.14.0      h2d02072_0  bioconda            
spades                        3.14.1      h2d02072_0  bioconda            
spades                        3.14.1      h2d02072_1  bioconda            
spades                        3.14.1      h95f258a_2  bioconda            
spades                        3.15.0      h633aebb_0  bioconda            
spades                        3.15.2      h633aebb_0  bioconda            
spades                        3.15.2      h95f258a_1  bioconda 

py35_0 means that you need python version 3.5 for this specific version. If you only have python3.4 and the package is only for version 3.5 you cannot install it with conda. (see here for more details: https://stackoverflow.com/questions/38411942/anaconda-conda-install-a-specific-package-version)

$ conda install spades=3.9.0

conda install spades=3.9.0
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /storage/apps/anaconda3

  added / updated specs:
    - spades=3.9.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    spades-3.9.0               |                0         9.1 MB  bioconda
    ------------------------------------------------------------
                                           Total:         9.1 MB

The following packages will be DOWNGRADED:

  spades                                           3.13.1-0 --> 3.9.0-0


Proceed ([y]/n)? y


Downloading and Extracting Packages
spades-3.9.0         | 9.1 MB    | ##################################################################################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done


conda install -c bacant -c conda-forge -c bioconda bacant=3.3.4



Tuesday, February 23, 2021

Resizing Windows VM screen size in Ubuntu 20.04

Open Devices from the File menu

Click Install Guest Additions CD image

Go to main directory of the computer with all the disks displayed

Click the CD Drive VirtualBox Guest Addtions

Double-click the VBoxWindowsAdditions.exe file depending on your operating system (x86 for 32 bit os and amd64 for 64 bit os) 

Press Right Ctrl + C to - This creates the VM windows with a proper resolution


Sunday, February 21, 2021

Ubuntu 18.04 to 20.04 Error: Please install all available updates for your release before upgrading

  $ sudo do-release-upgrade

Checking for a new Ubuntu release

Please install all available updates for your release before upgrading.

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.


$ apt list --upgradable
Listing... Done
linux-generic/bionic-updates,bionic-security 4.15.0.135.122 amd64 [upgradable from: 4.15.0.34.36]
linux-headers-generic/bionic-updates,bionic-security 4.15.0.135.122 amd64 [upgradable from: 4.15.0.34.36]
linux-image-generic/bionic-updates,bionic-security 4.15.0.135.122 amd64 [upgradable from: 4.15.0.34.36]


$ dpkg --get-selections | grep hold
linux-headers-generic hold
linux-image-generic hold


$ sudo apt-get install linux-headers-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-headers-4.15.0-135 linux-headers-4.15.0-135-generic
The following packages will be REMOVED:
  linux-generic
....

$ sudo apt-get install linux-image-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-image-4.15.0-135-generic linux-modules-4.15.0-

$ sudo reboot
 $ sudo do-release-upgrade  --> This updated my Ubuntu 18.04 to 20.04

Thursday, November 19, 2020

Regions with average quality BELOW this will be trimmed

BBDuk does not actually do naive quality trimming rather quality trimming is done using the Phred algorithm.

This is nicely explained by author Brian Bushnell in the following thread:

 http://seqanswers.com/forums/showthread.php?t=42776

Imagine a read with this quality profile:

40, 40, 40, 40, 2, 2, 2, 2, 40, 2

The Phred algorithm would trim the last 6 bases, because their average quality (calculated by summing the error probabilities) is 2.79, which is below 10. Trimming regions with average quality below a threshold gives the optimal result in terms of the ratio of retained bases to the expected number of errors.

In the following example, I ran the following command to filter bases at Q30.

bbduk.sh -Xmx6g in1=$R1.fastq in2=$R2.fastq out1=$R1\_bbmap_adaptertrimmed_Q30.fastq out2=$R2\_bbmap_adaptertrimmed_Q30.fastq ref=bbmap/resources/adapters.fa ktrim=r k=23 mink=11 hdist=1 qtrim=rl trimq=30 minavgquality=30

This does not mean that your reads will not have any bases with quality score less than Q30. Because the trimming is not based on naive trimming but phred score quality trimming. Thus, we still end up with bases less than Q30 probably in minor portion of our fastq data. 




Sunday, August 16, 2020

R package installation: Error in dyn.load(file, DLLpath = DLLpath, ...)

Error in dyn.load(file, DLLpath = DLLpath, ...) : 

  unable to load shared object '/home/user/R/x86_64-pc-linux-gnu-library/3.6/rlang/libs/rlang.so':

  /home/user/R/x86_64-pc-linux-gnu-library/3.6/rlang/libs/rlang.so: undefined symbol: R_removeVarFromFrame

Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load

Execution halted 


Resolve this by typing following command in R console

install.packages("rlang", type = "source")

Thursday, August 13, 2020

Downgrade R version 4.0 to R version 3.6

I have encountered problem working with R version 4.0 and wanted to downgrade to R version 3.6. Here is a way how to do this:

  1. Remove the currently installed R version using the following commands:

    sudo apt-get remove r-base-core
    sudo apt-get autoremove 
  2. Find the version that you need by running the following command:

    apt-cache showpkg r-base

The output should look something like this: 

Provides: 
4.0.2-1.1804.0 - 
4.0.1-1.1804.0 - 
4.0.0-1.1804.0 - 
3.6.3-1bionic - 
3.6.2-1bionic - 
3.6.1-3bionic - 
3.6.1-1bionic - 
3.6.0-2bionic - 
3.6.0-1bionic - 
3.5.3-1bionic - 
3.5.2-1bionic - 
3.5.1-2bionic - 
3.5.1-1bionic - 
3.5.0-1bionic - 
3.4.4-1ubuntu1 - 

So, I want to install 3.6.3-1bionic version. This can be achieved using the following command:

sudo apt-get install r-base-core=3.6.3-1bionic

Tuesday, September 17, 2019

locate: can not open `/var/lib/mlocate/mlocate.db': Permission denied - resolved

Recently, had this issue with CentOS.

locate: can not open `/var/lib/mlocate/mlocate.db': Permission denied

Had overcome this issue by updating with mlocate

$ sudo yum resintall mlocate

The problem has got solved!!

Friday, August 16, 2019

Installing BEAST2 and Beagle-lib from scratch

git clone --depth=1 https://github.com/beagle-dev/beagle-lib.git
cd beagle-lib
./autogen.sh
./configure --prefix=/home/user/Software/beast/beagle-lib
make install

export LD_LIBRARY_PATH=/home/user/Software/beast/beagle-lib/lib:$LD_LIBRARY_PATH
make check

beast/beagle-lib/examples/tinytest$ ./tinytest
Available resources:
Resource 0:
Name : CPU
Desc :
Flags: PROCESSOR_CPU PRECISION_DOUBLE PRECISION_SINGLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALING_DYNAMIC SCALERS_RAW SCALERS_LOG VECTOR_NONE VECTOR_SSE THREADING_NONE FRAMEWORK_CPU

Using resource 0:
Rsrc Name : CPU
Impl Name : CPU-4State-Single
Impl Desc : none
Flags: PROCESSOR_CPU PRECISION_SINGLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_NONE THREADING_NONE FRAMEWORK_CPU

logL = -1498.89802 (PAUP logL = -1498.89812)
sumLogL = -1498.89802


$ ./beast -beagle_info

                        BEAST v2.6.0, 2002-2019
             Bayesian Evolutionary Analysis Sampling Trees
                       Designed and developed by
 Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard
                                    
                   Centre for Computational Evolution
                         University of Auckland
                       r.bouckaert@auckland.ac.nz
                        alexei@cs.auckland.ac.nz
                                    
                   Institute of Evolutionary Biology
                        University of Edinburgh
                           a.rambaut@ed.ac.uk
                                    
                    David Geffen School of Medicine
                 University of California, Los Angeles
                           msuchard@ucla.edu
                                    
                      Downloads, Help & Resources:
                           http://beast2.org/
                                    
  Source code distributed under the GNU Lesser General Public License:
                   http://github.com/CompEvol/beast2
                                    
                           BEAST developers:
   Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, 
 Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, 
Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, 
          Oliver Pybus, Tim Vaughan, Chieh-Hsi Wu, Walter Xie
                                    
                               Thanks to:
          Roald Forsberg, Beth Shapiro and Korbinian Strimmer


--- BEAGLE RESOURCES ---

0 : CPU
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_SSE VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU


we have beagle can run with CPU. But cuda is not activated yet!

I have installed cuda driver based on the my Ubuntu desktop version.

Check the Ubuntu version using the following command:

$ uname -a
16.04.2-Ubuntu

So, accordingly installed the cuda toolkit from the following link:

https://developer.nvidia.com/cuda-downloads




once the cuda is installed, we need to check if it is properly installed. Follow the instructions to check if it is properly installed.

https://xcat-docs.readthedocs.io/en/stable/advanced/gpu/nvidia/verify_cuda_install.html


The tutorial is slightly old, I had to go to /usr/local/cuda-10.1/samples


Sometime, while installing, there can be error like this:

$ make
Making all in libhmsbeagle
make[1]: Entering directory '/home/user/Software/beast/beagle-lib/libhmsbeagle'
make  all-recursive
make[2]: Entering directory '/home/user/Software/beast/beagle-lib/libhmsbeagle'
Making all in GPU
make[3]: Entering directory '/home/user/Software/beast/beagle-lib/libhmsbeagle/GPU'
Making all in kernels
make[4]: Entering directory '/home/user/Software/beast/beagle-lib/libhmsbeagle/GPU/kernels'
echo "// auto-generated header file with CUDA kernels PTX code" > BeagleCUDA_kernels.h
/usr/bin/nvcc -o BeagleCUDA_kernels.ptx -ptx -DCUDA -DSTATE_COUNT=4 \
./kernels4.cu -O3 -arch compute_30 -Wno-deprecated-gpu-targets -DHAVE_CONFIG_H -I/home/user/Software/beast/beagle-lib -I/home/user/Software/beast/beagle-lib || { \rm BeagleCUDA_kernels.h; exit; }; \
echo "#define KERNELS_STRING_SP_4 \"" | sed 's/$/\\n\\/' >> BeagleCUDA_kernels.h; \
cat BeagleCUDA_kernels.ptx | sed 's/\"/\\"/g' | sed 's/$/\\n\\/' >> BeagleCUDA_kernels.h; \
echo "\"" >> BeagleCUDA_kernels.h
nvcc fatal   : Path to libdevice library not specified
for s in 16 32 48 64 80 128 192; do \
echo "Making state count = $s" ; \
/usr/bin/nvcc -o BeagleCUDA_kernels.ptx -ptx -DCUDA -DSTATE_COUNT=$s \
./kernelsX.cu -O3 -arch compute_30 -Wno-deprecated-gpu-targets -DHAVE_CONFIG_H -I/home/user/Software/beast/beagle-lib -I/home/user/Software/beast/beagle-lib || { \rm BeagleCUDA_kernels.h; exit; }; \
echo "#define KERNELS_STRING_SP_$s \"" | sed 's/$/\\n\\/' >> BeagleCUDA_kernels.h; \
cat BeagleCUDA_kernels.ptx | sed 's/\"/\\"/g' | sed 's/$/\\n\\/' >> BeagleCUDA_kernels.h; \
echo "\"" >> BeagleCUDA_kernels.h; \
done
Making state count = 16
nvcc fatal   : Path to libdevice library not specified
rm: cannot remove 'BeagleCUDA_kernels.h': No such file or directory
Makefile:518: recipe for target 'BeagleCUDA_kernels.h' failed
make[4]: *** [BeagleCUDA_kernels.h] Error 1
make[4]: Leaving directory '/home/user/Software/beast/beagle-lib/libhmsbeagle/GPU/kernels'
Makefile:700: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/user/Software/beast/beagle-lib/libhmsbeagle/GPU'
Makefile:622: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/user/Software/beast/beagle-lib/libhmsbeagle'
Makefile:465: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/user/Software/beast/beagle-lib/libhmsbeagle'
Makefile:611: recipe for target 'all-recursive' failed

make: *** [all-recursive] Error 1


Paste the location of cuda bin directory in bashrc (/usr/local/cuda-10.1/bin/)

export PATH="/usr/local/cuda-10.1/bin:$PATH"


$ ./beast -beagle_info

                        BEAST v2.6.0, 2002-2019
             Bayesian Evolutionary Analysis Sampling Trees
                       Designed and developed by
 Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard
                                    
                   Centre for Computational Evolution
                         University of Auckland
                       r.bouckaert@auckland.ac.nz
                        alexei@cs.auckland.ac.nz
                                    
                   Institute of Evolutionary Biology
                        University of Edinburgh
                           a.rambaut@ed.ac.uk
                                    
                    David Geffen School of Medicine
                 University of California, Los Angeles
                           msuchard@ucla.edu
                                    
                      Downloads, Help & Resources:
                           http://beast2.org/
                                    
  Source code distributed under the GNU Lesser General Public License:
                   http://github.com/CompEvol/beast2
                                    
                           BEAST developers:
   Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, 
 Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, 
Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, 
          Oliver Pybus, Tim Vaughan, Chieh-Hsi Wu, Walter Xie
                                    
                               Thanks to:
          Roald Forsberg, Beth Shapiro and Korbinian Strimmer


--- BEAGLE RESOURCES ---

0 : CPU
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_SSE VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

1 : Quadro P2000
    Global memory (MB): 5058
    Clock speed (Ghz): 1.48
    Number of cores: 1024

    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH COMPUTATION_ASYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_NONE THREADING_NONE PROCESSOR_GPU FRAMEWORK_CUDA


Voila! Beast with Beagle installed!!



Monday, July 8, 2019

GATK - Exception in thread "main" java.lang.IncompatibleClassChangeError

$ gatk VariantsToTable -V SNP.vcf -F CHROM -F POS -F QUAL -F DP4 -F MQ -O test

Using GATK jar /home/sw/gatk-4.1.1.0/gatk-package-4.1.1.0-local.jar
Running:
    java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -jar /home/prakki/sw/gatk-4.1.1.0/gatk-package-4.1.1.0-local.jar VariantsToTable -V 14DM017529_1032_HQ_SNP.vcf -F CHROM -F POS -F QUAL -F DP4 -F MQ -O test
Runtime.totalMemory()=2155872256
Exception in thread "main" java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/broadinstitute/hellbender/transformers/VariantTransformer. Method lambda$identity$76d6cab0$1(Lhtsjdk/variant/variantcontext/VariantContext;)Lhtsjdk/variant/variantcontext/VariantContext; at index 65 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
at org.broadinstitute.hellbender.transformers.VariantTransformer.identity(VariantTransformer.java:32)
at org.broadinstitute.hellbender.engine.VariantWalkerBase.makePreVariantFilterTransformer(VariantWalkerBase.java:131)
at org.broadinstitute.hellbender.engine.VariantWalkerBase.getTransformedVariantStream(VariantWalkerBase.java:155)
at org.broadinstitute.hellbender.engine.VariantWalker.traverse(VariantWalker.java:98)
at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:984)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:138)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:191)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:210)
at org.broadinstitute.hellbender.Main.runCommandLineProgram(Main.java:162)
at org.broadinstitute.hellbender.Main.mainEntry(Main.java:205)
at org.broadinstitute.hellbender.Main.main(Main.java:291)

Check for alternative versions

$  sudo update-alternatives --config java
[sudo] password for prakki:
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 2

Now, java version should have look something like this:

$ java -version 
openjdk version "1.8.0_212"
.....


$ gatk VariantsToTable -V SNP.vcf -F CHROM -F POS -F QUAL -F DP4 -F MQ -O test

Thursday, June 13, 2019

BEAST phylogeny - BEAGLE installation

Running a computational process on GPU is much faster than CPU. Just wanted to test this BEAST phylogeny tool. It was an amazing experience. GPU is way much faster. Just to get a glimpse of the GPU speed on 95 sample data each sequence  of 5 MB:


GPU is the winner!! But installation took time.

Here are the steps.

Follow the steps from :

https://github.com/beagle-dev/beagle-lib

If the beast -beagle info gives you only the message as below, then that means your cuda is not properly installed.

--- BEAGLE RESOURCES ---

0 : CPU


    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_SSE VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

I use ubuntu. So, I followed this tut:
 https://github.com/beagle-dev/beagle-lib/wiki/LinuxInstallInstructions

For my purpose, I have installed cuda toolkit from here:
https://developer.nvidia.com/cuda-downloads

$ sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.168-418.67_1.0-1_amd64.deb
(Reading database ... 396141 files and directories currently installed.)
Preparing to unpack cuda-repo-ubuntu1804-10-1-local-10.1.168-418.67_1.0-1_amd64.deb ...
Unpacking cuda-repo-ubuntu1804-10-1-local-10.1.168-418.67 (1.0-1) over (1.0-1) ...
Setting up cuda-repo-ubuntu1804-10-1-local-10.1.168-418.67 (1.0-1) ...



once the cuda is installed, we need to check if it is properly installed. Follow the instructions to check if it is properly installed.

https://xcat-docs.readthedocs.io/en/stable/advanced/gpu/nvidia/verify_cuda_install.html

If deviceQuery, bandwidthTest commands give similar result, then cuda is successfully installed.

Else if you receive an error like when you run  ./bin/x86_64/linux/release/deviceQuery
-> no CUDA-capable device is detected

That means either you need to switch the graphics cards or you need to select the appropriate driver. In my case, I had only one graphics card,

When I typed,

$  nvidia-smi -a
NVIDIA: API mismatch: the NVIDIA kernel module has version 295.59,
but this NVIDIA driver component has version 304.54.  Please make
sure that the kernel module and all NVIDIA driver components
have the same version.

You can check in the page, what graphics card you have and how to switch over (not my case).
For my case, I needed to select the appropriate driver since there is a mismatch.

so, I ran this command:

$ sudo ubuntu-drivers devices


So, I was recommended to use nvidia-driver-430 for my case, where as I was using driver-418.




So, I selected to driver-430, Apply changes and restart the system



$ ./bin/x86_64/linux/release/deviceQuery
./bin/x86_64/linux/release/deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "Quadro P2000"
  CUDA Driver Version / Runtime Version          10.1 / 10.1
  CUDA Capability Major/Minor version number:    6.1
.....


Result = PASS

$ ./bin/x86_64/linux/release/bandwidthTest
[CUDA Bandwidth Test] - Starting...
Running on...

 Device 0: Quadro P2000
 Quick Mode
.......
Result = PASS

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

It now works!!!!

Test beast with beagle now, you should see both CPU as well as GPU card in the resources list.

--- BEAGLE RESOURCES ---

0 : CPU
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_SSE VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

1 : Quadro P2000
    Global memory (MB): 5058
    Clock speed (Ghz): 1.48
    Number of cores: 1024
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH COMPUTATION_ASYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_NONE THREADING_NONE PROCESSOR_GPU FRAMEWORK_CUDA

Thats it!